Remove the no longer used engine and connection globals
All checks were successful
CI / Checks (Python 3.13) (push) Successful in 1m52s

Only `session` is used in the package.
Bound to the `engine`, it connects on its first query
instead of when the package is imported.
This commit is contained in:
Alexander Hess 2026-11-30 14:03:05 +01:00
commit 2b112f46e2
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -47,11 +47,6 @@ def db_connection(request):
engine = sa.create_engine(config.DATABASE_URI)
connection = engine.connect()
# Monkey patch the package's global `engine` and `connection` objects,
# just in case if it is used somewhere in the code base.
db.engine = engine
db.connection = connection
if request.param == "all_at_once":
with connection.begin():
connection.execute(sa.text(f"CREATE SCHEMA {config.CLEAN_SCHEMA};"))