(self)
| 1630 | self.assertRaises(Exception, self.apply_config, self.config3) |
| 1631 | |
| 1632 | def test_config4_ok(self): |
| 1633 | # A config file specifying a custom formatter class. |
| 1634 | with support.captured_stdout() as output: |
| 1635 | self.apply_config(self.config4) |
| 1636 | logger = logging.getLogger() |
| 1637 | try: |
| 1638 | raise RuntimeError() |
| 1639 | except RuntimeError: |
| 1640 | logging.exception("just testing") |
| 1641 | sys.stdout.seek(0) |
| 1642 | self.assertEqual(output.getvalue(), |
| 1643 | "ERROR:root:just testing\nGot a [RuntimeError]\n") |
| 1644 | # Original logger output is empty |
| 1645 | self.assert_log_lines([]) |
| 1646 | |
| 1647 | def test_config5_ok(self): |
| 1648 | self.test_config1_ok(config=self.config5) |
nothing calls this directly
no test coverage detected