Skip to content

Commit 16232b8

Browse files
committed
use threading_helper.start_threads
1 parent 3b29867 commit 16232b8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Lib/test/test_unittest/testmock/testthreadingmock.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,8 @@ def test_function():
211211
setswitchinterval(1e-6)
212212
try:
213213
threads = [threading.Thread(target=test_function) for _ in range(THREADS)]
214-
for thread in threads:
215-
thread.start()
216-
for thread in threads:
217-
thread.join()
214+
with threading_helper.start_threads(threads):
215+
pass
218216
finally:
219217
sys.setswitchinterval(oldswitchinterval)
220218

0 commit comments

Comments
 (0)