summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2008-07-18 09:00:00 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2008-07-18 09:00:00 (GMT)
commit70fdc95b96d1a756b214867339c0475211d0d6d6 (patch)
treeb01aae1db86a88b03267895d467e062b625166c4
parentbc7e34f692f098cebea089f80704d0ea98c297df (diff)
downloadcpython-70fdc95b96d1a756b214867339c0475211d0d6d6.zip
cpython-70fdc95b96d1a756b214867339c0475211d0d6d6.tar.gz
cpython-70fdc95b96d1a756b214867339c0475211d0d6d6.tar.bz2
Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch.
-rw-r--r--Lib/test/test_logging.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index b937411..85b0994 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -584,6 +584,9 @@ class ConfigFileTest(BaseTest):
datefmt=
"""
+ # config5 specifies a custom handler class to be loaded
+ config5 = config1.replace('class=StreamHandler', 'class=logging.StreamHandler')
+
def apply_config(self, conf):
try:
fn = tempfile.mktemp(".ini")
@@ -609,10 +612,10 @@ class ConfigFileTest(BaseTest):
# Original logger output is empty.
self.assert_log_lines([])
- def test_config1_ok(self):
+ def test_config1_ok(self, config=config1):
# A config file defining a sub-parser as well.
with captured_stdout() as output:
- self.apply_config(self.config1)
+ self.apply_config(config)
logger = logging.getLogger("compiler.parser")
# Both will output a message
logger.info(self.next_message())
@@ -647,6 +650,8 @@ class ConfigFileTest(BaseTest):
# Original logger output is empty
self.assert_log_lines([])
+ def test_config5_ok(self):
+ self.test_config1_ok(config=self.config5)
class LogRecordStreamHandler(StreamRequestHandler):