Back to index

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

List of all members.

Public Member Functions

def test_rapid_restart
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 _putter

Detailed Description

Definition at line 1344 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._TestManagerRestart._putter (   cls,
  address,
  authkey 
) [private]

Definition at line 1347 of file test_multiprocessing.py.

01347 
01348     def _putter(cls, address, authkey):
01349         manager = QueueManager(
01350             address=address, authkey=authkey, serializer=SERIALIZER)
01351         manager.connect()
01352         queue = manager.get_queue()
01353         queue.put('hello world')

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 1354 of file test_multiprocessing.py.

01354 
01355     def test_rapid_restart(self):
01356         authkey = os.urandom(32)
01357         manager = QueueManager(
01358             address=('localhost', 0), authkey=authkey, serializer=SERIALIZER)
01359         srvr = manager.get_server()
01360         addr = srvr.address
01361         # Close the connection.Listener socket which gets opened as a part
01362         # of manager.get_server(). It's not needed for the test.
01363         srvr.listener.close()
01364         manager.start()
01365 
01366         p = self.Process(target=self._putter, args=(manager.address, authkey))
01367         p.start()
01368         queue = manager.get_queue()
01369         self.assertEqual(queue.get(), 'hello world')
01370         del queue
01371         manager.shutdown()
01372         manager = QueueManager(
01373             address=addr, authkey=authkey, serializer=SERIALIZER)
01374         try:
01375             manager.start()
01376         except IOError as e:
01377             if e.errno != errno.EADDRINUSE:
01378                 raise
01379             # Retry after some time, in case the old socket was lingering
01380             # (sporadic failure on buildbots)
01381             time.sleep(1.0)
01382             manager = QueueManager(
01383                 address=addr, authkey=authkey, serializer=SERIALIZER)
01384         manager.shutdown()
01385 
01386 #
01387 #
01388 #

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: