Back to index

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

List of all members.

Public Member Functions

def test_enable_logging
def test_level
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',)

Private Member Functions

def _test_level

Detailed Description

Definition at line 1866 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._TestLogging._test_level (   cls,
  conn 
) [private]

Definition at line 1879 of file test_multiprocessing.py.

01879 
01880     def _test_level(cls, conn):
01881         logger = multiprocessing.get_logger()
01882         conn.send(logger.getEffectiveLevel())

Here is the call graph for this function:

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

01870 
01871     def test_enable_logging(self):
01872         logger = multiprocessing.get_logger()
01873         logger.setLevel(util.SUBWARNING)
01874         self.assertTrue(logger is not None)
01875         logger.debug('this will not be printed')
01876         logger.info('nor will this')
01877         logger.setLevel(LOG_LEVEL)

Here is the call graph for this function:

Definition at line 1883 of file test_multiprocessing.py.

01883 
01884     def test_level(self):
01885         LEVEL1 = 32
01886         LEVEL2 = 37
01887 
01888         logger = multiprocessing.get_logger()
01889         root_logger = logging.getLogger()
01890         root_level = root_logger.level
01891 
01892         reader, writer = multiprocessing.Pipe(duplex=False)
01893 
01894         logger.setLevel(LEVEL1)
01895         self.Process(target=self._test_level, args=(writer,)).start()
01896         self.assertEqual(LEVEL1, reader.recv())
01897 
01898         logger.setLevel(logging.NOTSET)
01899         root_logger.setLevel(LEVEL2)
01900         self.Process(target=self._test_level, args=(writer,)).start()
01901         self.assertEqual(LEVEL2, reader.recv())
01902 
01903         root_logger.setLevel(root_level)
01904         logger.setLevel(level=LOG_LEVEL)
01905 
01906 
01907 # class _TestLoggingProcessName(BaseTestCase):
01908 #
01909 #     def handle(self, record):
01910 #         assert record.processName == multiprocessing.current_process().name
01911 #         self.__handled = True
01912 #
01913 #     def test_logging(self):
01914 #         handler = logging.Handler()
01915 #         handler.handle = self.handle
01916 #         self.__handled = False
01917 #         # Bypass getLogger() and side-effects
01918 #         logger = logging.getLoggerClass()(
01919 #                 'multiprocessing.test.TestLoggingProcessName')
01920 #         logger.addHandler(handler)
01921 #         logger.propagate = False
01922 #
01923 #         logger.warn('foo')
01924 #         assert self.__handled
01925 
01926 #
01927 # Test to verify handle verification, see issue 3321
01928 #

Here is the call graph for this function:


Member Data Documentation

Reimplemented from test.test_multiprocessing.BaseTestCase.

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