summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-01 10:01:14 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-01 10:01:14 (GMT)
commit263dcd20a374d540c8f0bc07332f1657adf6da83 (patch)
treec44955a3ff494353583163d4634cae512e7836dc /Lib/test/test_bz2.py
parent8218bd4caf683ee98c450a093bf171dbca6c4849 (diff)
downloadcpython-263dcd20a374d540c8f0bc07332f1657adf6da83.zip
cpython-263dcd20a374d540c8f0bc07332f1657adf6da83.tar.gz
cpython-263dcd20a374d540c8f0bc07332f1657adf6da83.tar.bz2
Issue #23799: Added test.support.start_threads() for running and cleaning up
multiple threads.
Diffstat (limited to 'Lib/test/test_bz2.py')
-rw-r--r--Lib/test/test_bz2.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index 1535e8e..beef275 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -493,10 +493,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",))