summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Noller <jnoller@gmail.com>2009-11-21 14:38:23 (GMT)
committerJesse Noller <jnoller@gmail.com>2009-11-21 14:38:23 (GMT)
commit814d02dcd1b30a98f9a34c710be35de6db82aa40 (patch)
tree72a84dcd59377fdad528d78757c8431a7cc8d735
parent7bdd8d946ba3913ad8631f4d7bbc952f16144747 (diff)
downloadcpython-814d02dcd1b30a98f9a34c710be35de6db82aa40.zip
cpython-814d02dcd1b30a98f9a34c710be35de6db82aa40.tar.gz
cpython-814d02dcd1b30a98f9a34c710be35de6db82aa40.tar.bz2
issue6615: Additional test for logging support in multiprocessing
-rw-r--r--Lib/test/test_multiprocessing.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index b16629b..07d7a02 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -1722,6 +1722,26 @@ class _TestLogging(BaseTestCase):
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
#