Skip to content

Commit e85bfdf

Browse files
committed
dispose of engine to avoid resource warning
1 parent 8692805 commit e85bfdf

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_tutorial/test_sql_databases/test_tutorial001.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def get_client(request: pytest.FixtureRequest):
4545

4646
with TestClient(mod.app) as c:
4747
yield c
48+
# Clean up connection explicitely to avoid resource warning
49+
mod.engine.dispose()
4850

4951

5052
def test_crud_app(client: TestClient):

tests/test_tutorial/test_sql_databases/test_tutorial002.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def get_client(request: pytest.FixtureRequest):
4545

4646
with TestClient(mod.app) as c:
4747
yield c
48+
# Clean up connection explicitely to avoid resource warning
49+
mod.engine.dispose()
4850

4951

5052
def test_crud_app(client: TestClient):

0 commit comments

Comments
 (0)