summaryrefslogtreecommitdiff
path: root/Lib/test/test_threading_local.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-01 13:06:18 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-01 13:06:18 +0300
commitc05e260ecb822431cf5bdcd02b7cb0f4cfc88f6b (patch)
treefb71efc4179189df04b94d4f0e7d628b2cee62b0 /Lib/test/test_threading_local.py
parenta7726624239367a72f5117700e675d5915a40714 (diff)
parent263dcd20a374d540c8f0bc07332f1657adf6da83 (diff)
downloadcpython-git-c05e260ecb822431cf5bdcd02b7cb0f4cfc88f6b.tar.gz
Issue #23799: Added test.support.start_threads() for running and cleaning up
multiple threads.
Diffstat (limited to 'Lib/test/test_threading_local.py')
-rw-r--r--Lib/test/test_threading_local.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py
index c886a25d8a..c7f394cf60 100644
--- a/Lib/test/test_threading_local.py
+++ b/Lib/test/test_threading_local.py
@@ -64,14 +64,9 @@ class BaseLocalTest:
# Simply check that the variable is correctly set
self.assertEqual(local.x, i)
- threads= []
- for i in range(10):
- t = threading.Thread(target=f, args=(i,))
- t.start()
- threads.append(t)
-
- for t in threads:
- t.join()
+ with support.start_threads(threading.Thread(target=f, args=(i,))
+ for i in range(10)):
+ pass
def test_derived_cycle_dealloc(self):
# http://bugs.python.org/issue6990