diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2008-09-03 09:20:05 +0000 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2008-09-03 09:20:05 +0000 |
commit | c99c472609fcec3ab566a9caf5bd3e7d4dc21677 (patch) | |
tree | 490a144c362ffb35efd048a0fc5e3c78407db798 /Lib/test/test_logging.py | |
parent | b22d644d6805ef5516c5a9e5008c32be3d544cbb (diff) | |
download | cpython-c99c472609fcec3ab566a9caf5bd3e7d4dc21677.tar.gz |
Issue #3726: Allowed spaces in separators in logging configuration files.
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r-- | Lib/test/test_logging.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 85b0994987..6ed8ca2a43 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -587,6 +587,48 @@ class ConfigFileTest(BaseTest): # config5 specifies a custom handler class to be loaded config5 = config1.replace('class=StreamHandler', 'class=logging.StreamHandler') + # config6 uses ', ' delimiters in the handlers and formatters sections + config6 = """ + [loggers] + keys=root,parser + + [handlers] + keys=hand1, hand2 + + [formatters] + keys=form1, form2 + + [logger_root] + level=WARNING + handlers= + + [logger_parser] + level=DEBUG + handlers=hand1 + propagate=1 + qualname=compiler.parser + + [handler_hand1] + class=StreamHandler + level=NOTSET + formatter=form1 + args=(sys.stdout,) + + [handler_hand2] + class=FileHandler + level=NOTSET + formatter=form1 + args=('test.blah', 'a') + + [formatter_form1] + format=%(levelname)s ++ %(message)s + datefmt= + + [formatter_form2] + format=%(message)s + datefmt= + """ + def apply_config(self, conf): try: fn = tempfile.mktemp(".ini") @@ -653,6 +695,9 @@ class ConfigFileTest(BaseTest): def test_config5_ok(self): self.test_config1_ok(config=self.config5) + def test_config6_ok(self): + self.test_config1_ok(config=self.config6) + class LogRecordStreamHandler(StreamRequestHandler): """Handler for a streaming logging request. It saves the log message in the |