(self)
| 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. |
nothing calls this directly
no test coverage detected