(self)
| 1651 | self.test_config1_ok(config=self.config6) |
| 1652 | |
| 1653 | def test_config7_ok(self): |
| 1654 | with support.captured_stdout() as output: |
| 1655 | self.apply_config(self.config1a) |
| 1656 | logger = logging.getLogger("compiler.parser") |
| 1657 | # See issue #11424. compiler-hyphenated sorts |
| 1658 | # between compiler and compiler.xyz and this |
| 1659 | # was preventing compiler.xyz from being included |
| 1660 | # in the child loggers of compiler because of an |
| 1661 | # overzealous loop termination condition. |
| 1662 | hyphenated = logging.getLogger('compiler-hyphenated') |
| 1663 | # All will output a message |
| 1664 | logger.info(self.next_message()) |
| 1665 | logger.error(self.next_message()) |
| 1666 | hyphenated.critical(self.next_message()) |
| 1667 | self.assert_log_lines([ |
| 1668 | ('INFO', '1'), |
| 1669 | ('ERROR', '2'), |
| 1670 | ('CRITICAL', '3'), |
| 1671 | ], stream=output) |
| 1672 | # Original logger output is empty. |
| 1673 | self.assert_log_lines([]) |
| 1674 | with support.captured_stdout() as output: |
| 1675 | self.apply_config(self.config7) |
| 1676 | logger = logging.getLogger("compiler.parser") |
| 1677 | self.assertFalse(logger.disabled) |
| 1678 | # Both will output a message |
| 1679 | logger.info(self.next_message()) |
| 1680 | logger.error(self.next_message()) |
| 1681 | logger = logging.getLogger("compiler.lexer") |
| 1682 | # Both will output a message |
| 1683 | logger.info(self.next_message()) |
| 1684 | logger.error(self.next_message()) |
| 1685 | # Will not appear |
| 1686 | hyphenated.critical(self.next_message()) |
| 1687 | self.assert_log_lines([ |
| 1688 | ('INFO', '4'), |
| 1689 | ('ERROR', '5'), |
| 1690 | ('INFO', '6'), |
| 1691 | ('ERROR', '7'), |
| 1692 | ], stream=output) |
| 1693 | # Original logger output is empty. |
| 1694 | self.assert_log_lines([]) |
| 1695 | |
| 1696 | def test_config8_ok(self): |
| 1697 |
nothing calls this directly
no test coverage detected