Back to index

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

List of all members.

Public Member Functions

def setUp
def test_value
def test_rawvalue
def test_getobj_getlock
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',)
list codes_values

Private Member Functions

def _test

Detailed Description

Definition at line 825 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._TestValue._test (   cls,
  values 
) [private]

Definition at line 841 of file test_multiprocessing.py.

00841 
00842     def _test(cls, values):
00843         for sv, cv in zip(values, cls.codes_values):
00844             sv.value = cv[2]
00845 

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

00836 
00837     def setUp(self):
00838         if not HAS_SHAREDCTYPES:
00839             self.skipTest("requires multiprocessing.sharedctypes")

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 867 of file test_multiprocessing.py.

00867 
00868     def test_getobj_getlock(self):
00869         val1 = self.Value('i', 5)
00870         lock1 = val1.get_lock()
00871         obj1 = val1.get_obj()
00872 
00873         val2 = self.Value('i', 5, lock=None)
00874         lock2 = val2.get_lock()
00875         obj2 = val2.get_obj()
00876 
00877         lock = self.Lock()
00878         val3 = self.Value('i', 5, lock=lock)
00879         lock3 = val3.get_lock()
00880         obj3 = val3.get_obj()
00881         self.assertEqual(lock, lock3)
00882 
00883         arr4 = self.Value('i', 5, lock=False)
00884         self.assertFalse(hasattr(arr4, 'get_lock'))
00885         self.assertFalse(hasattr(arr4, 'get_obj'))
00886 
00887         self.assertRaises(AttributeError, self.Value, 'i', 5, lock='navalue')
00888 
00889         arr5 = self.RawValue('i', 5)
00890         self.assertFalse(hasattr(arr5, 'get_lock'))
00891         self.assertFalse(hasattr(arr5, 'get_obj'))
00892 

Here is the call graph for this function:

Definition at line 864 of file test_multiprocessing.py.

00864 
00865     def test_rawvalue(self):
00866         self.test_value(raw=True)

Here is the call graph for this function:

def test.test_multiprocessing._TestValue.test_value (   self,
  raw = False 
)

Definition at line 846 of file test_multiprocessing.py.

00846 
00847     def test_value(self, raw=False):
00848         if raw:
00849             values = [self.RawValue(code, value)
00850                       for code, value, _ in self.codes_values]
00851         else:
00852             values = [self.Value(code, value)
00853                       for code, value, _ in self.codes_values]
00854 
00855         for sv, cv in zip(values, self.codes_values):
00856             self.assertEqual(sv.value, cv[1])
00857 
00858         proc = self.Process(target=self._test, args=(values,))
00859         proc.start()
00860         proc.join()
00861 
00862         for sv, cv in zip(values, self.codes_values):
00863             self.assertEqual(sv.value, cv[2])

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

tuple test.test_multiprocessing._TestValue.ALLOWED_TYPES = ('processes',) [static]

Reimplemented from test.test_multiprocessing.BaseTestCase.

Definition at line 827 of file test_multiprocessing.py.

Initial value:
[
        ('i', 4343, 24234),
        ('d', 3.625, -4.25),
        ('h', -232, 234),
        ('c', latin('x'), latin('y'))
        ]

Definition at line 829 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: