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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013GAeg4Jo6xjZzjwy9QDWMQ
This commit is contained in:
2026-10-05 16:54:00 +02:00
co-authored by Claude Opus 5.5
parent 4e5f0d0654
commit a8495c023c
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())