diff --git a/tests/test_note_usage.py b/tests/test_note_usage.py index b57f6b3..d223e6d 100644 --- a/tests/test_note_usage.py +++ b/tests/test_note_usage.py @@ -9,6 +9,22 @@ from unittest.mock import AsyncMock, MagicMock, patch import pytest + +@pytest.fixture(autouse=True) +def _no_supersession(): + """The auto-inject menu now asks which of its lines are superseded (#278). + + That is a real database call on a path these tests exercise without one. + Stubbed to "nothing superseded" — the ordinary state — rather than hidden + behind a try/except in the product, which would make the code lie about + what it does. The label's own behaviour is covered in + tests/test_supersession_ranking.py. + """ + with patch("scribe.services.plugin_context.superseded_ids", + AsyncMock(return_value=set())): + yield + + from scribe.services import note_usage from scribe.services.note_usage import ( empty_usage, diff --git a/tests/test_retrieval_scopes.py b/tests/test_retrieval_scopes.py index 478edce..3f4fa6b 100644 --- a/tests/test_retrieval_scopes.py +++ b/tests/test_retrieval_scopes.py @@ -17,6 +17,22 @@ from unittest.mock import AsyncMock, MagicMock, patch import pytest +@pytest.fixture(autouse=True) +def _no_supersession(): + """The auto-inject menu now asks which of its lines are superseded (#278). + + That is a real database call on a path these tests exercise without one. + Stubbed to "nothing superseded" — the ordinary state — rather than hidden + behind a try/except in the product, which would make the code lie about + what it does. The label's own behaviour is covered in + tests/test_supersession_ranking.py. + """ + with patch("scribe.services.plugin_context.superseded_ids", + AsyncMock(return_value=set())): + yield + + + def _note(id=1, user_id=7, title="A note", note_type="note", is_task=False, task_kind="work"): n = MagicMock() diff --git a/tests/test_services_plugin_context.py b/tests/test_services_plugin_context.py index 82b96e1..e45c98e 100644 --- a/tests/test_services_plugin_context.py +++ b/tests/test_services_plugin_context.py @@ -3,6 +3,22 @@ from unittest.mock import AsyncMock, MagicMock, patch import pytest +@pytest.fixture(autouse=True) +def _no_supersession(): + """The auto-inject menu now asks which of its lines are superseded (#278). + + That is a real database call on a path these tests exercise without one. + Stubbed to "nothing superseded" — the ordinary state — rather than hidden + behind a try/except in the product, which would make the code lie about + what it does. The label's own behaviour is covered in + tests/test_supersession_ranking.py. + """ + with patch("scribe.services.plugin_context.superseded_ids", + AsyncMock(return_value=set())): + yield + + + def _rule(rid, title, topic_id): r = MagicMock() r.id, r.title, r.topic_id = rid, title, topic_id