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
+10
View File
@@ -3,9 +3,19 @@
import sys
import textwrap
import pytest
from fluksio.sdk.imports import digest_of, reached
@pytest.fixture(autouse=True)
def _forget_studies():
"""The packages below are temporary files under names other tests use too."""
yield
for name in [n for n in sys.modules if n.split(".")[0] in ("study", "arm")]:
del sys.modules[name]
def _write(root, name, body):
path = root / f"{name}.py"
path.write_text(textwrap.dedent(body).lstrip())