Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-90473: Skip test_queue when threading is not available
Almost all tests were already skipped anyways. The remaining tests are
not useful without threading primitives like locks and conditions.
  • Loading branch information
tiran committed Jun 11, 2022
commit 0c3793fd6ca2113342009b2c5d5aeab6e322051d
5 changes: 2 additions & 3 deletions Lib/test/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from test.support import import_helper
from test.support import threading_helper

# queue module depends on threading primitives
threading_helper.requires_working_threading(module=True)

py_queue = import_helper.import_fresh_module('queue', blocked=['_queue'])
c_queue = import_helper.import_fresh_module('queue', fresh=['_queue'])
Expand Down Expand Up @@ -87,7 +89,6 @@ def do_exceptional_blocking_test(self,block_func, block_args, trigger_func,
self.fail("trigger thread ended but event never set")


@threading_helper.requires_working_threading()
class BaseQueueTestMixin(BlockingTestMixin):
def setUp(self):
self.cum = 0
Expand Down Expand Up @@ -291,7 +292,6 @@ class CPriorityQueueTest(PriorityQueueTest, unittest.TestCase):
class FailingQueueException(Exception): pass


@threading_helper.requires_working_threading()
class FailingQueueTest(BlockingTestMixin):

def setUp(self):
Expand Down Expand Up @@ -467,7 +467,6 @@ def consume_timeout(self, q, results, sentinel):
return
results.append(val)

@threading_helper.requires_working_threading()
def run_threads(self, n_threads, q, inputs, feed_func, consume_func):
results = []
sentinel = None
Expand Down