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

Method do_exceptional_blocking_test

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

Source from the content-addressed store, hash-verified

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,
77 trigger_args, expected_exception_class):
78 thread = _TriggerThread(trigger_func, trigger_args)
79 thread.start()
80 try:
81 try:
82 block_func(*block_args)
83 except expected_exception_class:
84 raise
85 else:
86 self.fail("expected exception of kind %r" %
87 expected_exception_class)
88 finally:
89 threading_helper.join_thread(thread) # make sure the thread terminates
90 if not thread.startedEvent.is_set():
91 self.fail("trigger thread ended but event never set")
92
93
94class BaseQueueTestMixin(BlockingTestMixin):

Callers 1

failing_queue_testMethod · 0.80

Calls 5

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

Tested by

no test coverage detected