fix: more test fixes

This commit is contained in:
Alex committed 2026-08-08 12:28:20 +01:00
1 parent 132a2de3bf
commit c5d2329a61
3 files changed
+39 -8

No files matched your search

@@ -25,6 +25,21 @@ TEAM_SHARED = "src-team-shared"
FOREIGN = "src-foreign"
@pytest.fixture(autouse=True)
def _stub_db(monkeypatch):
"""``_load_request_sources`` opens a connection; it needn't be a real one."""
import contextlib
from unittest.mock import MagicMock
@contextlib.contextmanager
def _conn():
yield MagicMock()
# Patch the name bound in stream_processor, not the source module: it is
# imported at module load, so rebinding the origin has no effect.
monkeypatch.setattr(sp_mod, "db_readonly", _conn)
@pytest.fixture
def access_model(monkeypatch):
"""``can_access`` semantics: own it, or hold a direct team grant."""