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/test_threadsignals.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/test_threadsignals.py')
-rw-r--r-- | Lib/test/test_threadsignals.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py index eeacd36..15e8078 100644 --- a/Lib/test/test_threadsignals.py +++ b/Lib/test/test_threadsignals.py @@ -5,6 +5,7 @@ import signal import os import sys from test import support +from test.support import threading_helper import _thread as thread import time @@ -39,7 +40,7 @@ def send_signals(): class ThreadSignals(unittest.TestCase): def test_signals(self): - with support.wait_threads_exit(): + with threading_helper.wait_threads_exit(): # Test signal handling semantics of threads. # We spawn a thread, have the thread send two signals, and # wait for it to finish. Check that we got both signals @@ -129,7 +130,7 @@ class ThreadSignals(unittest.TestCase): def other_thread(): rlock.acquire() - with support.wait_threads_exit(): + with threading_helper.wait_threads_exit(): thread.start_new_thread(other_thread, ()) # Wait until we can't acquire it without blocking... while rlock.acquire(blocking=False): @@ -165,7 +166,7 @@ class ThreadSignals(unittest.TestCase): time.sleep(0.5) lock.release() - with support.wait_threads_exit(): + with threading_helper.wait_threads_exit(): thread.start_new_thread(other_thread, ()) # Wait until we can't acquire it without blocking... while lock.acquire(blocking=False): @@ -212,7 +213,7 @@ class ThreadSignals(unittest.TestCase): os.kill(process_pid, signal.SIGUSR1) done.release() - with support.wait_threads_exit(): + with threading_helper.wait_threads_exit(): # Send the signals from the non-main thread, since the main thread # is the only one that can process signals. thread.start_new_thread(send_signals, ()) |