MCPcopy Index your code
hub / github.com/python/cpython / test_config0_using_cp_ok

Method test_config0_using_cp_ok

Lib/test/test_logging.py:1605–1621  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1603 self.assert_log_lines([])
1604
1605 def test_config0_using_cp_ok(self):
1606 # A simple config file which overrides the default settings.
1607 with support.captured_stdout() as output:
1608 file = io.StringIO(textwrap.dedent(self.config0))
1609 cp = configparser.ConfigParser()
1610 cp.read_file(file)
1611 logging.config.fileConfig(cp)
1612 logger = logging.getLogger()
1613 # Won't output anything
1614 logger.info(self.next_message())
1615 # Outputs a message
1616 logger.error(self.next_message())
1617 self.assert_log_lines([
1618 ('ERROR', '2'),
1619 ], stream=output)
1620 # Original logger output is empty.
1621 self.assert_log_lines([])
1622
1623 def test_config1_ok(self, config=config1):
1624 # A config file defining a sub-parser as well.

Callers

nothing calls this directly

Calls 7

getLoggerMethod · 0.80
next_messageMethod · 0.80
assert_log_linesMethod · 0.80
dedentMethod · 0.45
read_fileMethod · 0.45
infoMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected