import time import pytest from app import access @pytest.fixture(autouse=True) def legacy_owner_session(request, monkeypatch): """Pre-v0.10 tests expect projects directly under data_root: run them as the owner. Isolation itself is covered by test_access.py (real anonymous sessions).""" if request.module.__name__.endswith("test_access"): return monkeypatch.setattr(access.Sessions, "new_anonymous", lambda self: {"kind": "hf", "user": access.OWNER, "sid": "0" * 32, "exp": int(time.time()) + 3600})