(self)
| 3383 | self.assertRaises(Exception, self.apply_config, self.config3) |
| 3384 | |
| 3385 | def test_config4_ok(self): |
| 3386 | # A config specifying a custom formatter class. |
| 3387 | with support.captured_stdout() as output: |
| 3388 | self.apply_config(self.config4) |
| 3389 | self.check_handler('hand1', logging.StreamHandler) |
| 3390 | #logger = logging.getLogger() |
| 3391 | try: |
| 3392 | raise RuntimeError() |
| 3393 | except RuntimeError: |
| 3394 | logging.exception("just testing") |
| 3395 | sys.stdout.seek(0) |
| 3396 | self.assertEqual(output.getvalue(), |
| 3397 | "ERROR:root:just testing\nGot a [RuntimeError]\n") |
| 3398 | # Original logger output is empty |
| 3399 | self.assert_log_lines([]) |
| 3400 | |
| 3401 | def test_config4a_ok(self): |
| 3402 | # A config specifying a custom formatter class. |
nothing calls this directly
no test coverage detected