summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_queue.py
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-05-27 22:10:27 (GMT)
committerGitHub <noreply@github.com>2020-05-27 22:10:27 (GMT)
commite80697d687b610bd7fb9104af905dec8f0bc55a7 (patch)
treec848b98eaec2d959237fda725cf47b059f34b12a /Lib/test/test_queue.py
parent7d80b35af1ee03834ae4af83e920dee89c2bc273 (diff)
downloadcpython-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_queue.py')
-rw-r--r--Lib/test/test_queue.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py
index d88e28a..7b23699 100644
--- a/Lib/test/test_queue.py
+++ b/Lib/test/test_queue.py
@@ -7,6 +7,7 @@ import time
import unittest
import weakref
from test import support
+from test.support import threading_helper
py_queue = support.import_fresh_module('queue', blocked=['_queue'])
c_queue = support.import_fresh_module('queue', fresh=['_queue'])
@@ -63,7 +64,7 @@ class BlockingTestMixin:
block_func)
return self.result
finally:
- support.join_thread(thread) # make sure the thread terminates
+ threading_helper.join_thread(thread) # make sure the thread terminates
# Call this instead if block_func is supposed to raise an exception.
def do_exceptional_blocking_test(self,block_func, block_args, trigger_func,
@@ -79,7 +80,7 @@ class BlockingTestMixin:
self.fail("expected exception of kind %r" %
expected_exception_class)
finally:
- support.join_thread(thread) # make sure the thread terminates
+ threading_helper.join_thread(thread) # make sure the thread terminates
if not thread.startedEvent.is_set():
self.fail("trigger thread ended but event never set")
@@ -484,7 +485,7 @@ class BaseSimpleQueueTest:
args=(q, results, sentinel))
for i in range(n_consumers)]
- with support.start_threads(feeders + consumers):
+ with threading_helper.start_threads(feeders + consumers):
pass
self.assertFalse(exceptions)