Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_multiprocessing.TestInitializers Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_manager_initializer
def test_pool_initializer

Public Attributes

 mgr
 ns

Detailed Description

Definition at line 2048 of file test_multiprocessing.py.


Member Function Documentation

Definition at line 2049 of file test_multiprocessing.py.

02049 
02050     def setUp(self):
02051         self.mgr = multiprocessing.Manager()
02052         self.ns = self.mgr.Namespace()
02053         self.ns.test = 0

Here is the caller graph for this function:

Definition at line 2054 of file test_multiprocessing.py.

02054 
02055     def tearDown(self):
02056         self.mgr.shutdown()

Here is the caller graph for this function:

Definition at line 2057 of file test_multiprocessing.py.

02057 
02058     def test_manager_initializer(self):
02059         m = multiprocessing.managers.SyncManager()
02060         self.assertRaises(TypeError, m.start, 1)
02061         m.start(initializer, (self.ns,))
02062         self.assertEqual(self.ns.test, 1)
02063         m.shutdown()

Here is the call graph for this function:

Definition at line 2064 of file test_multiprocessing.py.

02064 
02065     def test_pool_initializer(self):
02066         self.assertRaises(TypeError, multiprocessing.Pool, initializer=1)
02067         p = multiprocessing.Pool(1, initializer, (self.ns,))
02068         p.close()
02069         p.join()
02070         self.assertEqual(self.ns.test, 1)
02071 
02072 #
02073 # Issue 5155, 5313, 5331: Test process in processes
02074 # Verifies os.close(sys.stdin.fileno) vs. sys.stdin.close() behavior
02075 #

Here is the call graph for this function:


Member Data Documentation

Definition at line 2050 of file test_multiprocessing.py.

Definition at line 2051 of file test_multiprocessing.py.


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