Remove the no longer used engine and connection globals
All checks were successful
CI / Checks (Python 3.13) (push) Successful in 1m52s
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:
parent
e9dbf528d7
commit
2b112f46e2
1 changed files with 5 additions and 16 deletions
|
|
@ -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};"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue