Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
test.test_multiprocessing._TestEvent Class Reference
Inheritance diagram for test.test_multiprocessing._TestEvent:
Inheritance graph
[legend]
Collaboration diagram for test.test_multiprocessing._TestEvent:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_event
def assertTimingAlmostEqual
def assertReturnsIfImplemented
def __reduce__

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

tuple ALLOWED_TYPES = ('processes', 'manager', 'threads')

Private Member Functions

def _test_event

Detailed Description

Definition at line 782 of file test_multiprocessing.py.


Member Function Documentation

def test.test_multiprocessing.BaseTestCase.__reduce__ (   self,
  args 
) [inherited]

Definition at line 124 of file test_multiprocessing.py.

00124 
00125     def __reduce__(self, *args):
00126         raise NotImplementedError("shouldn't try to pickle a test case")

def test.test_multiprocessing._TestEvent._test_event (   cls,
  event 
) [private]

Definition at line 785 of file test_multiprocessing.py.

00785 
00786     def _test_event(cls, event):
00787         time.sleep(TIMEOUT2)
00788         event.set()

Here is the caller graph for this function:

def test.test_multiprocessing.BaseTestCase.assertReturnsIfImplemented (   self,
  value,
  func,
  args 
) [inherited]

Definition at line 114 of file test_multiprocessing.py.

00114 
00115     def assertReturnsIfImplemented(self, value, func, *args):
00116         try:
00117             res = func(*args)
00118         except NotImplementedError:
00119             pass
00120         else:
00121             return self.assertEqual(value, res)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_multiprocessing.BaseTestCase.assertTimingAlmostEqual (   self,
  a,
  b 
) [inherited]

Definition at line 110 of file test_multiprocessing.py.

00110 
00111     def assertTimingAlmostEqual(self, a, b):
00112         if CHECK_TIMINGS:
00113             self.assertAlmostEqual(a, b, 1)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 789 of file test_multiprocessing.py.

00789 
00790     def test_event(self):
00791         event = self.Event()
00792         wait = TimingWrapper(event.wait)
00793 
00794         # Removed temporarily, due to API shear, this does not
00795         # work with threading._Event objects. is_set == isSet
00796         self.assertEqual(event.is_set(), False)
00797 
00798         # Removed, threading.Event.wait() will return the value of the __flag
00799         # instead of None. API Shear with the semaphore backed mp.Event
00800         self.assertEqual(wait(0.0), False)
00801         self.assertTimingAlmostEqual(wait.elapsed, 0.0)
00802         self.assertEqual(wait(TIMEOUT1), False)
00803         self.assertTimingAlmostEqual(wait.elapsed, TIMEOUT1)
00804 
00805         event.set()
00806 
00807         # See note above on the API differences
00808         self.assertEqual(event.is_set(), True)
00809         self.assertEqual(wait(), True)
00810         self.assertTimingAlmostEqual(wait.elapsed, 0.0)
00811         self.assertEqual(wait(TIMEOUT1), True)
00812         self.assertTimingAlmostEqual(wait.elapsed, 0.0)
00813         # self.assertEqual(event.is_set(), True)
00814 
00815         event.clear()
00816 
00817         #self.assertEqual(event.is_set(), False)
00818 
00819         self.Process(target=self._test_event, args=(event,)).start()
00820         self.assertEqual(wait(), True)
00821 
00822 #
00823 #
00824 #

Here is the call graph for this function:


Member Data Documentation

tuple test.test_multiprocessing.BaseTestCase.ALLOWED_TYPES = ('processes', 'manager', 'threads') [static, inherited]

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


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