Skip to content

Commit 2af6ce9

Browse files
committed
refactor test
1 parent d4e5779 commit 2af6ce9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Lib/test/test_free_threading/test_enumerate.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
from test.support import threading_helper
66

7+
threading_helper.requires_working_threading(module=True)
78

89
class EnumerateThreading(unittest.TestCase):
910

1011
@threading_helper.reap_threads
11-
@threading_helper.requires_working_threading()
1212
def test_threading(self):
1313
number_of_threads = 10
1414
number_of_iterations = 8
@@ -29,10 +29,8 @@ def work(enum):
2929
for ii in range(number_of_threads):
3030
worker_threads.append(
3131
Thread(target=work, args=[enum]))
32-
for t in worker_threads:
33-
t.start()
34-
for t in worker_threads:
35-
t.join()
32+
with threading_helper.start_threads(worker_threads):
33+
pass
3634

3735
barrier.reset()
3836

0 commit comments

Comments
 (0)