(self)
| 3326 | self.assertRaises(Exception, self.apply_config, self.config3) |
| 3327 | |
| 3328 | def test_config4_ok(self): |
| 3329 | # A config specifying a custom formatter class. |
| 3330 | with support.captured_stdout() as output: |
| 3331 | self.apply_config(self.config4) |
| 3332 | self.check_handler('hand1', logging.StreamHandler) |
| 3333 | #logger = logging.getLogger() |
| 3334 | try: |
| 3335 | raise RuntimeError() |
| 3336 | except RuntimeError: |
| 3337 | logging.exception("just testing") |
| 3338 | sys.stdout.seek(0) |
| 3339 | self.assertEqual(output.getvalue(), |
| 3340 | "ERROR:root:just testing\nGot a [RuntimeError]\n") |
| 3341 | # Original logger output is empty |
| 3342 | self.assert_log_lines([]) |
| 3343 | |
| 3344 | def test_config4a_ok(self): |
| 3345 | # A config specifying a custom formatter class. |
nothing calls this directly
no test coverage detected