summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-01 10:06:18 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-01 10:06:18 (GMT)
commitc05e260ecb822431cf5bdcd02b7cb0f4cfc88f6b (patch)
treefb71efc4179189df04b94d4f0e7d628b2cee62b0 /Lib/test/test_bz2.py
parenta7726624239367a72f5117700e675d5915a40714 (diff)
parent263dcd20a374d540c8f0bc07332f1657adf6da83 (diff)
downloadcpython-c05e260ecb822431cf5bdcd02b7cb0f4cfc88f6b.zip
cpython-c05e260ecb822431cf5bdcd02b7cb0f4cfc88f6b.tar.gz
cpython-c05e260ecb822431cf5bdcd02b7cb0f4cfc88f6b.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 2fe3f2a..bf9887b 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -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",))