Skip to content

Commit 829df8c

Browse files
cfsmp3claude
andcommitted
fix(test): Add mock db query chain to test_start_test_no_artifact_found
Add create_mock_db_query helper to avoid AsyncMock behavior in Python 3.12+ that causes 'coroutine object has no attribute filter'. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 12c8431 commit 829df8c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_ci/test_controllers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,6 +2060,10 @@ def test_start_test_no_artifact_found(self, mock_log, mock_gcp_instance,
20602060
g.db.add(customized_test)
20612061
g.db.commit()
20622062

2063+
# Set up mock db query chain to avoid AsyncMock behavior in Python 3.13+
2064+
mock_query = create_mock_db_query(mock_g)
2065+
mock_query.c.got = MagicMock()
2066+
20632067
start_test(mock.ANY, self.app, mock_g.db, repository, test, mock.ANY)
20642068

20652069
# Should log critical with diagnostic message and mark test failed

0 commit comments

Comments
 (0)