Skip to content

Commit 8839e71

Browse files
committed
use threading_helper.start_threads
1 parent c4165de commit 8839e71

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Lib/test/test_concurrent_futures/test_future.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
PENDING, RUNNING, CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED, Future)
77

88
from test import support
9+
from test.support import threading_helper
910

1011
from .util import (
1112
PENDING_FUTURE, RUNNING_FUTURE, CANCELLED_FUTURE,
@@ -330,14 +331,8 @@ def get_snapshot():
330331
snapshot = f._get_snapshot()
331332
results.append(snapshot)
332333

333-
threads = []
334-
for _ in range(4):
335-
t = threading.Thread(target=get_snapshot)
336-
threads.append(t)
337-
t.start()
338-
339-
for t in threads:
340-
t.join()
334+
threads = [threading.Thread(target=get_snapshot) for _ in range(4)]
335+
threading_helper.start_threads(threads)
341336

342337
# All snapshots should be identical for a finished future
343338
expected = (True, False, 100, None)

0 commit comments

Comments
 (0)