(self)
| 3460 | |
| 3461 | # Same as test_config_7_ok but don't disable old loggers. |
| 3462 | def test_config_8_ok(self): |
| 3463 | with support.captured_stdout() as output: |
| 3464 | self.apply_config(self.config1) |
| 3465 | logger = logging.getLogger("compiler.parser") |
| 3466 | # All will output a message |
| 3467 | logger.info(self.next_message()) |
| 3468 | logger.error(self.next_message()) |
| 3469 | self.assert_log_lines([ |
| 3470 | ('INFO', '1'), |
| 3471 | ('ERROR', '2'), |
| 3472 | ], stream=output) |
| 3473 | # Original logger output is empty. |
| 3474 | self.assert_log_lines([]) |
| 3475 | with support.captured_stdout() as output: |
| 3476 | self.apply_config(self.config8) |
| 3477 | self.check_handler('hand1', logging.StreamHandler) |
| 3478 | logger = logging.getLogger("compiler.parser") |
| 3479 | self.assertFalse(logger.disabled) |
| 3480 | # Both will output a message |
| 3481 | logger.info(self.next_message()) |
| 3482 | logger.error(self.next_message()) |
| 3483 | logger = logging.getLogger("compiler.lexer") |
| 3484 | # Both will output a message |
| 3485 | logger.info(self.next_message()) |
| 3486 | logger.error(self.next_message()) |
| 3487 | self.assert_log_lines([ |
| 3488 | ('INFO', '3'), |
| 3489 | ('ERROR', '4'), |
| 3490 | ('INFO', '5'), |
| 3491 | ('ERROR', '6'), |
| 3492 | ], stream=output) |
| 3493 | # Original logger output is empty. |
| 3494 | self.assert_log_lines([]) |
| 3495 | |
| 3496 | def test_config_8a_ok(self): |
| 3497 | with support.captured_stdout() as output: |
nothing calls this directly
no test coverage detected