(self)
| 1644 | self.assertRaises(Exception, self.apply_config, self.config3) |
| 1645 | |
| 1646 | def test_config4_ok(self): |
| 1647 | # A config file specifying a custom formatter class. |
| 1648 | with support.captured_stdout() as output: |
| 1649 | self.apply_config(self.config4) |
| 1650 | logger = logging.getLogger() |
| 1651 | try: |
| 1652 | raise RuntimeError() |
| 1653 | except RuntimeError: |
| 1654 | logging.exception("just testing") |
| 1655 | sys.stdout.seek(0) |
| 1656 | self.assertEqual(output.getvalue(), |
| 1657 | "ERROR:root:just testing\nGot a [RuntimeError]\n") |
| 1658 | # Original logger output is empty |
| 1659 | self.assert_log_lines([]) |
| 1660 | |
| 1661 | def test_config5_ok(self): |
| 1662 | self.test_config1_ok(config=self.config5) |
nothing calls this directly
no test coverage detected