Close the connection after running the migrations
The pooled `connection` stayed open until garbage collection, which emits a `ResourceWarning`
This commit is contained in:
parent
ee5a372b2b
commit
e01421bb96
1 changed files with 2 additions and 1 deletions
|
|
@ -31,7 +31,8 @@ def include_object(obj, _name, type_, _reflected, _compare_to):
|
|||
return True
|
||||
|
||||
|
||||
engine = sa.create_engine(velofy_config.DATABASE_URI)
|
||||
# Without a `pool`, the `connection` really closes after the migrations
|
||||
engine = sa.create_engine(velofy_config.DATABASE_URI, poolclass=sa.pool.NullPool)
|
||||
|
||||
test_schema = f"_{velofy_config.CLEAN_SCHEMA}" if os.getenv("TESTING") else ""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue