test semantics

This commit is contained in:
2026-03-21 15:23:06 +03:00
parent 2da548fd71
commit e86204df6c
14 changed files with 467 additions and 101 deletions

View File

@@ -204,6 +204,7 @@ def test_delete_validation_report_deletes_dashboard_scope_and_linked_tasks():
screenshot_path=None,
)
# @RISK: db.query side_effect chain may not propagate through .filter().first() — verify mock chain setup is correct for this test.
first_query = MagicMock()
first_query.first.return_value = target_record
@@ -270,6 +271,7 @@ def test_delete_validation_report_swallows_linked_task_cleanup_failure():
screenshot_path=None,
)
# @RISK: db.query side_effect chain may not propagate through .filter().first() — verify mock chain setup is correct for this test.
first_query = MagicMock()
first_query.first.return_value = record

View File

@@ -73,6 +73,7 @@ def test_decrypt_invalid_data():
# @INVARIANT: Chained calls beyond Session spec create unconstrained intermediate mocks; only top-level query/add/commit are spec-enforced.
@pytest.fixture
def mock_db():
# @RISK: query() returns unconstrained MagicMock — chain beyond query() has no spec protection. Consider create_autospec(Session) for full chain safety.
return MagicMock(spec=Session)