Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_queue.BlockingTestMixin Class Reference
Inheritance diagram for test.test_queue.BlockingTestMixin:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def do_blocking_test
def do_exceptional_blocking_test

Public Attributes

 t
 result

Detailed Description

Definition at line 47 of file test_queue.py.


Member Function Documentation

def test.test_queue.BlockingTestMixin.do_blocking_test (   self,
  block_func,
  block_args,
  trigger_func,
  trigger_args 
)

Definition at line 49 of file test_queue.py.

00049 
00050     def do_blocking_test(self, block_func, block_args, trigger_func, trigger_args):
00051         self.t = _TriggerThread(trigger_func, trigger_args)
00052         self.t.start()
00053         self.result = block_func(*block_args)
00054         # If block_func returned before our thread made the call, we failed!
00055         if not self.t.startedEvent.is_set():
00056             self.fail("blocking function '%r' appeared not to block" %
00057                       block_func)
00058         self.t.join(10) # make sure the thread terminates
00059         if self.t.is_alive():
00060             self.fail("trigger function '%r' appeared to not return" %
00061                       trigger_func)
00062         return self.result

Here is the caller graph for this function:

def test.test_queue.BlockingTestMixin.do_exceptional_blocking_test (   self,
  block_func,
  block_args,
  trigger_func,
  trigger_args,
  expected_exception_class 
)

Definition at line 65 of file test_queue.py.

00065 
00066                                    trigger_args, expected_exception_class):
00067         self.t = _TriggerThread(trigger_func, trigger_args)
00068         self.t.start()
00069         try:
00070             try:
00071                 block_func(*block_args)
00072             except expected_exception_class:
00073                 raise
00074             else:
00075                 self.fail("expected exception of kind %r" %
00076                                  expected_exception_class)
00077         finally:
00078             self.t.join(10) # make sure the thread terminates
00079             if self.t.is_alive():
00080                 self.fail("trigger function '%r' appeared to not return" %
00081                                  trigger_func)
00082             if not self.t.startedEvent.is_set():
00083                 self.fail("trigger thread ended but event never set")
00084 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 52 of file test_queue.py.

Definition at line 50 of file test_queue.py.


The documentation for this class was generated from the following file: