From 25aeb9e77f6958cc9ee080db437e5b171aa7dd82 Mon Sep 17 00:00:00 2001 From: Sumedh Sakdeo Date: Sat, 14 Feb 2026 18:52:30 -0800 Subject: [PATCH] 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 --- tests/catalog/test_hive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/catalog/test_hive.py b/tests/catalog/test_hive.py index 88b653e44f..a8c0c943da 100644 --- a/tests/catalog/test_hive.py +++ b/tests/catalog/test_hive.py @@ -1314,8 +1314,8 @@ def test_hive_wait_for_lock() -> None: assert catalog._client.check_lock.call_count == 3 # lock wait should exit with WaitingForLockException finally after enough retries + catalog._client.check_lock.reset_mock() catalog._client.check_lock.side_effect = [waiting for _ in range(10)] - catalog._client.check_lock.call_count = 0 with pytest.raises(WaitingForLockException): catalog._wait_for_lock("db", "tbl", lockid, catalog._client) assert catalog._client.check_lock.call_count == 5