(self)
| 3394 | |
| 3395 | # Same as test_config_7_ok but don't disable old loggers. |
| 3396 | def test_config_8_ok(self): |
| 3397 | with support.captured_stdout() as output: |
| 3398 | self.apply_config(self.config1) |
| 3399 | logger = logging.getLogger("compiler.parser") |
| 3400 | # All will output a message |
| 3401 | logger.info(self.next_message()) |
| 3402 | logger.error(self.next_message()) |
| 3403 | self.assert_log_lines([ |
| 3404 | ('INFO', '1'), |
| 3405 | ('ERROR', '2'), |
| 3406 | ], stream=output) |
| 3407 | # Original logger output is empty. |
| 3408 | self.assert_log_lines([]) |
| 3409 | with support.captured_stdout() as output: |
| 3410 | self.apply_config(self.config8) |
| 3411 | self.check_handler('hand1', logging.StreamHandler) |
| 3412 | logger = logging.getLogger("compiler.parser") |
| 3413 | self.assertFalse(logger.disabled) |
| 3414 | # Both will output a message |
| 3415 | logger.info(self.next_message()) |
| 3416 | logger.error(self.next_message()) |
| 3417 | logger = logging.getLogger("compiler.lexer") |
| 3418 | # Both will output a message |
| 3419 | logger.info(self.next_message()) |
| 3420 | logger.error(self.next_message()) |
| 3421 | self.assert_log_lines([ |
| 3422 | ('INFO', '3'), |
| 3423 | ('ERROR', '4'), |
| 3424 | ('INFO', '5'), |
| 3425 | ('ERROR', '6'), |
| 3426 | ], stream=output) |
| 3427 | # Original logger output is empty. |
| 3428 | self.assert_log_lines([]) |
| 3429 | |
| 3430 | def test_config_8a_ok(self): |
| 3431 | with support.captured_stdout() as output: |
nothing calls this directly
no test coverage detected