test semantics
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user