
python-checkins at python
Nov 21, 2009, 8:20 AM
Post #1 of 1
(142 views)
Permalink
|
|
r76438 - python/trunk/Lib/test/test_multiprocessing.py
|
|
Author: jesse.noller Date: Sat Nov 21 15:38:23 2009 New Revision: 76438 Log: issue6615: Additional test for logging support in multiprocessing Modified: python/trunk/Lib/test/test_multiprocessing.py Modified: python/trunk/Lib/test/test_multiprocessing.py ============================================================================== --- python/trunk/Lib/test/test_multiprocessing.py (original) +++ python/trunk/Lib/test/test_multiprocessing.py Sat Nov 21 15:38:23 2009 @@ -1722,6 +1722,26 @@ root_logger.setLevel(root_level) logger.setLevel(level=LOG_LEVEL) + +class _TestLoggingProcessName(BaseTestCase): + + def handle(self, record): + assert record.processName == multiprocessing.current_process().name + self.__handled = True + + def test_logging(self): + handler = logging.Handler() + handler.handle = self.handle + self.__handled = False + # Bypass getLogger() and side-effects + logger = logging.getLoggerClass()( + 'multiprocessing.test.TestLoggingProcessName') + logger.addHandler(handler) + logger.propagate = False + + logger.warn('foo') + assert self.__handled + # # Test to verify handle verification, see issue 3321 # _______________________________________________ Python-checkins mailing list Python-checkins [at] python http://mail.python.org/mailman/listinfo/python-checkins
|