Skip to content

Commit bbea0f0

Browse files
authored
fix: Hive catalog test failure on CPython 3.13.12 (#3043)
# Rationale for this change While reviewing some open PRs #3041, #3042, I noticed CI kept failing on the Python 3.13 job in the hive tests. Turns out [CPython 3.13.12 ](https://docs.python.org/3.13/whatsnew/changelog.html#id3)was just released and included a change python/cpython#142651 which made `Mock.call_count` thread-safe by deriving it from `len(call_args_list)`. This broke our hive test, which was resetting the counter with `mock.call_count = 0` directly. This switches to use reset_mock(), which properly clears all the internal call tracking state. ## Are these changes tested? `make test` passes ## Are there any user-facing changes? no
1 parent 0124bf2 commit bbea0f0

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)