We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe7be86 commit 758084cCopy full SHA for 758084c
1 file changed
Lib/test/test_unittest/testmock/testthreadingmock.py
@@ -198,23 +198,23 @@ def test_reset_mock_resets_wait(self):
198
m.assert_called_once()
199
200
def test_call_count_thread_safe(self):
201
-
+
202
m = ThreadingMock()
203
204
# 3k loops reliably reproduces the issue while keeping runtime ~0.6s
205
LOOPS = 3_000
206
THREADS = 10
207
208
def test_function():
209
for _ in range(LOOPS):
210
m()
211
212
threads = [threading.Thread(target=test_function) for _ in range(THREADS)]
213
for thread in threads:
214
thread.start()
215
216
thread.join()
217
218
self.assertEqual(m.call_count, LOOPS * THREADS,
219
f"Expected {LOOPS * THREADS}, got {m.call_count}")
220
0 commit comments