Issue #23799: Added test.support.start_threads() for running and cleaning up

multiple threads.
This commit is contained in:
Serhiy Storchaka 2015-04-01 13:06:18 +03:00
commit c05e260ecb
9 changed files with 75 additions and 78 deletions

View file

@ -507,10 +507,8 @@ class BZ2FileTest(BaseTest):
for i in range(5):
f.write(data)
threads = [threading.Thread(target=comp) for i in range(nthreads)]
for t in threads:
t.start()
for t in threads:
t.join()
with support.start_threads(threads):
pass
def testWithoutThreading(self):
module = support.import_fresh_module("bz2", blocked=("threading",))