refine teardown
All checks were successful
Backend CI / unit-test (push) Successful in 25s

This commit is contained in:
2025-09-14 21:09:26 +02:00
parent 2c22f20b48
commit 7041cc654e
3 changed files with 2 additions and 2 deletions

View File

@@ -42,7 +42,6 @@ def database_ctx(db: Database) -> Generator[Database, None, None]:
yield db
finally:
db.dispose()
SQLModel.metadata.clear()
def test_select_one_executes() -> None:
@@ -77,6 +76,7 @@ def test_sqlite_pragmas_applied() -> None:
def test_rollback_on_exception() -> None:
db = create_database(None)
SQLModel.metadata.clear()
db.init_db()
with database_ctx(db):
# Create table then insert and raise inside the same session to force rollback