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

Method test_config0_ok

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

Source from the content-addressed store, hash-verified

1588 logging.config.fileConfig(file, encoding="utf-8", **kwargs)
1589
1590 def test_config0_ok(self):
1591 # A simple config file which overrides the default settings.
1592 with support.captured_stdout() as output:
1593 self.apply_config(self.config0)
1594 logger = logging.getLogger()
1595 # Won't output anything
1596 logger.info(self.next_message())
1597 # Outputs a message
1598 logger.error(self.next_message())
1599 self.assert_log_lines([
1600 ('ERROR', '2'),
1601 ], stream=output)
1602 # Original logger output is empty.
1603 self.assert_log_lines([])
1604
1605 def test_config0_using_cp_ok(self):
1606 # A simple config file which overrides the default settings.

Callers

nothing calls this directly

Calls 6

apply_configMethod · 0.95
getLoggerMethod · 0.80
next_messageMethod · 0.80
assert_log_linesMethod · 0.80
infoMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected