diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-05-17 00:06:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-17 00:06:14 (GMT) |
commit | 6b5b85aecf4db796a05582202a6c875b36eae516 (patch) | |
tree | 31958de9808093d58c6014958ae94afeead34923 /Lib/test/test_thread.py | |
parent | aaa053652556aa4e59cb68f3983a09ced1d1fe2a (diff) | |
download | cpython-6b5b85aecf4db796a05582202a6c875b36eae516.zip cpython-6b5b85aecf4db796a05582202a6c875b36eae516.tar.gz cpython-6b5b85aecf4db796a05582202a6c875b36eae516.tar.bz2 |
bpo-30357: test_thread now uses threading_cleanup() (#1592) (#1622)
test_thread: setUp() now uses support.threading_setup() and
support.threading_cleanup() to wait until threads complete to avoid
random side effects on following tests.
Co-Authored-By: Grzegorz Grzywacz <grzegorz.grzywacz@nazwa.pl>
(cherry picked from commit 79ef7f8e88a4972c4aecf95cfc5cd934f1861e08)
Diffstat (limited to 'Lib/test/test_thread.py')
-rw-r--r-- | Lib/test/test_thread.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index ef3059b..3909b75 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -20,6 +20,7 @@ def verbose_print(arg): with _print_mutex: print(arg) + class BasicThreadTest(unittest.TestCase): def setUp(self): @@ -31,6 +32,9 @@ class BasicThreadTest(unittest.TestCase): self.running = 0 self.next_ident = 0 + key = support.threading_setup() + self.addCleanup(support.threading_cleanup, *key) + class ThreadRunningTests(BasicThreadTest): |