Skip to content

Commit 25aeb9e

Browse files
sumedhsakdeoclaude
andcommitted
fix: properly reset mock call_count in test_hive_wait_for_lock
Setting `mock.call_count = 0` does not actually reset the mock's internal call tracking, causing the second assertion to see accumulated calls from both test phases. Use `reset_mock()` instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7d4a8ef commit 25aeb9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/catalog/test_hive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,8 +1314,8 @@ def test_hive_wait_for_lock() -> None:
13141314
assert catalog._client.check_lock.call_count == 3
13151315

13161316
# lock wait should exit with WaitingForLockException finally after enough retries
1317+
catalog._client.check_lock.reset_mock()
13171318
catalog._client.check_lock.side_effect = [waiting for _ in range(10)]
1318-
catalog._client.check_lock.call_count = 0
13191319
with pytest.raises(WaitingForLockException):
13201320
catalog._wait_for_lock("db", "tbl", lockid, catalog._client)
13211321
assert catalog._client.check_lock.call_count == 5

0 commit comments

Comments
 (0)