Back to index

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

List of all members.

Public Member Functions

def test_async_error_callback
def test_unpickleable_result
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', )

Detailed Description

Definition at line 1124 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.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 1127 of file test_multiprocessing.py.

01127 
01128     def test_async_error_callback(self):
01129         p = multiprocessing.Pool(2)
01130 
01131         scratchpad = [None]
01132         def errback(exc):
01133             scratchpad[0] = exc
01134 
01135         res = p.apply_async(raising, error_callback=errback)
01136         self.assertRaises(KeyError, res.get)
01137         self.assertTrue(scratchpad[0])
01138         self.assertIsInstance(scratchpad[0], KeyError)
01139 
01140         p.close()
01141         p.join()

Here is the call graph for this function:

Definition at line 1142 of file test_multiprocessing.py.

01142 
01143     def test_unpickleable_result(self):
01144         from multiprocessing.pool import MaybeEncodingError
01145         p = multiprocessing.Pool(2)
01146 
01147         # Make sure we don't lose pool processes because of encoding errors.
01148         for iteration in range(20):
01149 
01150             scratchpad = [None]
01151             def errback(exc):
01152                 scratchpad[0] = exc
01153 
01154             res = p.apply_async(unpickleable_result, error_callback=errback)
01155             self.assertRaises(MaybeEncodingError, res.get)
01156             wrapped = scratchpad[0]
01157             self.assertTrue(wrapped)
01158             self.assertIsInstance(scratchpad[0], MaybeEncodingError)
01159             self.assertIsNotNone(wrapped.exc)
01160             self.assertIsNotNone(wrapped.value)
01161 
01162         p.close()
01163         p.join()

Here is the call graph for this function:


Member Data Documentation

Reimplemented from test.test_multiprocessing.BaseTestCase.

Definition at line 1125 of file test_multiprocessing.py.

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: