diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-01 10:01:14 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-04-01 10:01:14 (GMT) |
commit | 263dcd20a374d540c8f0bc07332f1657adf6da83 (patch) | |
tree | c44955a3ff494353583163d4634cae512e7836dc /Lib/test/test_threading_local.py | |
parent | 8218bd4caf683ee98c450a093bf171dbca6c4849 (diff) | |
download | cpython-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_threading_local.py')
-rw-r--r-- | Lib/test/test_threading_local.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py index c886a25..c7f394c 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 |