MCPcopy Index your code
hub / github.com/python/cpython / do_blocking_test

Method do_blocking_test

Lib/test/test_queue.py:62–73  ·  view source on GitHub ↗
(self, block_func, block_args, trigger_func, trigger_args)

Source from the content-addressed store, hash-verified

60class BlockingTestMixin:
61
62 def do_blocking_test(self, block_func, block_args, trigger_func, trigger_args):
63 thread = _TriggerThread(trigger_func, trigger_args)
64 thread.start()
65 try:
66 self.result = block_func(*block_args)
67 # If block_func returned before our thread made the call, we failed!
68 if not thread.startedEvent.is_set():
69 self.fail("blocking function %r appeared not to block" %
70 block_func)
71 return self.result
72 finally:
73 threading_helper.join_thread(thread) # make sure the thread terminates
74
75 # Call this instead if block_func is supposed to raise an exception.
76 def do_exceptional_blocking_test(self,block_func, block_args, trigger_func,

Callers 2

basic_queue_testMethod · 0.80
failing_queue_testMethod · 0.80

Calls 5

_TriggerThreadClass · 0.85
join_threadMethod · 0.80
startMethod · 0.45
is_setMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected