Make narrowed backend test runs and the quarantine test order- and load-proof

The session db fixture now disposes the engine before deleting the file, since a
module under a no-op db (tests/sdk, tests/flow) may have connected first; the
sdk import tests forget the study packages they import; the supervision tests
keep the real quarantine length so it cannot expire mid-assertion.
This commit is contained in:
2026-10-05 16:54:00 +02:00
parent 43e777b7c7
commit f14f7bd413
3 changed files with 23 additions and 7 deletions
+3
View File
@@ -50,6 +50,9 @@ def db() -> Generator[Session, None, None]:
assert url.database and url.database.endswith("_test.db"), url.database
path = Path(url.database)
# A module that ran before this fixture (one under a no-op `db`) may have
# connected already; a pooled connection would keep the unlinked file.
engine.dispose()
path.unlink(missing_ok=True)
# The real path, so the suite runs against a database built the way a
# deployment's is — including the alembic stamp the app's own startup