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