diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-05-27 22:10:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 22:10:27 (GMT) |
commit | e80697d687b610bd7fb9104af905dec8f0bc55a7 (patch) | |
tree | c848b98eaec2d959237fda725cf47b059f34b12a /Lib/test/lock_tests.py | |
parent | 7d80b35af1ee03834ae4af83e920dee89c2bc273 (diff) | |
download | cpython-e80697d687b610bd7fb9104af905dec8f0bc55a7.zip cpython-e80697d687b610bd7fb9104af905dec8f0bc55a7.tar.gz cpython-e80697d687b610bd7fb9104af905dec8f0bc55a7.tar.bz2 |
bpo-40275: Adding threading_helper submodule in test.support (GH-20263)
Diffstat (limited to 'Lib/test/lock_tests.py')
-rw-r--r-- | Lib/test/lock_tests.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py index b397525..d69bcc9 100644 --- a/Lib/test/lock_tests.py +++ b/Lib/test/lock_tests.py @@ -11,6 +11,7 @@ import unittest import weakref from test import support +from test.support import threading_helper requires_fork = unittest.skipUnless(hasattr(os, 'fork'), @@ -37,7 +38,7 @@ class Bunch(object): self.started = [] self.finished = [] self._can_exit = not wait_before_exit - self.wait_thread = support.wait_threads_exit() + self.wait_thread = threading_helper.wait_threads_exit() self.wait_thread.__enter__() def task(): @@ -73,10 +74,10 @@ class Bunch(object): class BaseTestCase(unittest.TestCase): def setUp(self): - self._threads = support.threading_setup() + self._threads = threading_helper.threading_setup() def tearDown(self): - support.threading_cleanup(*self._threads) + threading_helper.threading_cleanup(*self._threads) support.reap_children() def assertTimeout(self, actual, expected): @@ -239,7 +240,7 @@ class LockTests(BaseLockTests): lock.acquire() phase.append(None) - with support.wait_threads_exit(): + with threading_helper.wait_threads_exit(): start_new_thread(f, ()) while len(phase) == 0: _wait() |