diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index b46613876137b3..2f9abe078fc2ea 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -22,6 +22,7 @@ def verbose_print(arg): print arg + class BasicThreadTest(unittest.TestCase): def setUp(self): @@ -33,6 +34,9 @@ def setUp(self): self.running = 0 self.next_ident = 0 + key = test_support.threading_setup() + self.addCleanup(test_support.threading_cleanup, *key) + class ThreadRunningTests(BasicThreadTest): diff --git a/Misc/ACKS b/Misc/ACKS index 96cc90ed3644e5..01bcd3b834f162 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -507,6 +507,7 @@ Fabian Groffen Eric Groo Dag Gruneau Filip GruszczyƄski +Grzegorz Grzywacz Thomas Guettler Anuj Gupta Michael Guravage diff --git a/Misc/NEWS b/Misc/NEWS index 4c9f2d375e8911..56e882a0a513c8 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12106,6 +12106,10 @@ IDLE Tests ----- +- bpo-30357: 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. Initial patch written by Grzegorz + Grzywacz. - Refactor test_logging to use unittest.