Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc7fe5a

Browse files
authored
Merge pull request #31154 from meeseeksmachine/auto-backport-of-pr-31153-on-v3.10.x
Backport PR #31153 on branch v3.10.x (TST: Use correct method of clearing mock objects)
2 parents 8db8148 + b9d7e7f commit cc7fe5a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def _impl_test_interactive_timers():
648648
assert mock.call_count > 1
649649

650650
# Now turn it into a single shot timer and verify only one gets triggered
651-
mock.call_count = 0
651+
mock.reset_mock()
652652
timer.single_shot = True
653653
timer.start()
654654
plt.pause(pause_time)

lib/matplotlib/tests/test_colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,7 @@ def test_norm_callback():
15901590
assert increment.call_count == 2
15911591

15921592
# We only want autoscale() calls to send out one update signal
1593-
increment.call_count = 0
1593+
increment.reset_mock()
15941594
norm.autoscale([0, 1, 2])
15951595
assert increment.call_count == 1
15961596

0 commit comments

Comments
 (0)