MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_config0_using_cp_ok

Method test_config0_using_cp_ok

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

Source from the content-addressed store, hash-verified

1589 self.assert_log_lines([])
1590
1591 def test_config0_using_cp_ok(self):
1592 # A simple config file which overrides the default settings.
1593 with support.captured_stdout() as output:
1594 file = io.StringIO(textwrap.dedent(self.config0))
1595 cp = configparser.ConfigParser()
1596 cp.read_file(file)
1597 logging.config.fileConfig(cp)
1598 logger = logging.getLogger()
1599 # Won't output anything
1600 logger.info(self.next_message())
1601 # Outputs a message
1602 logger.error(self.next_message())
1603 self.assert_log_lines([
1604 ('ERROR', '2'),
1605 ], stream=output)
1606 # Original logger output is empty.
1607 self.assert_log_lines([])
1608
1609 def test_config1_ok(self, config=config1):
1610 # A config file defining a sub-parser as well.

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected