(self, block_func, block_args, trigger_func, trigger_args)
| 60 | class 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, |
no test coverage detected