mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-30357: test_thread now uses threading_cleanup() (#1592)
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>
This commit is contained in:
parent
83a2c28798
commit
79ef7f8e88
3 changed files with 10 additions and 0 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue