summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorLucas Cimon <lucas.cimon@gmail.com>2019-10-31 08:06:25 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2019-10-31 08:06:25 (GMT)
commitb15100fe7def8580c78ed16f0bb4b72b2ae7af3f (patch)
treef65caddb35b979e84b8cc1ecd09995b6769c1ea8 /Lib/test
parent79d4ed102a5069c6cebaed2627cb1645637f0429 (diff)
downloadcpython-b15100fe7def8580c78ed16f0bb4b72b2ae7af3f.zip
cpython-b15100fe7def8580c78ed16f0bb4b72b2ae7af3f.tar.gz
cpython-b15100fe7def8580c78ed16f0bb4b72b2ae7af3f.tar.bz2
bpo-38586: setting logging.Handler .name property in fileConfig (GH-16918)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_logging.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 74ccf48..53b5bfc 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -1591,6 +1591,30 @@ class ConfigFileTest(BaseTest):
self.apply_config(self.disable_test, disable_existing_loggers=False)
self.assertFalse(logger.disabled)
+ def test_config_set_handler_names(self):
+ test_config = """
+ [loggers]
+ keys=root
+
+ [handlers]
+ keys=hand1
+
+ [formatters]
+ keys=form1
+
+ [logger_root]
+ handlers=hand1
+
+ [handler_hand1]
+ class=StreamHandler
+ formatter=form1
+
+ [formatter_form1]
+ format=%(levelname)s ++ %(message)s
+ """
+ self.apply_config(test_config)
+ self.assertEquals(logging.getLogger().handlers[0].name, 'hand1')
+
def test_defaults_do_no_interpolation(self):
"""bpo-33802 defaults should not get interpolated"""
ini = textwrap.dedent("""