(self)
| 574 | |
| 575 | @pytest.mark.skipif(not hasattr(TestCase, "assertLogs"), reason="requires TestCase.assertLogs") |
| 576 | def test_log_bad_config(self): |
| 577 | app = MyApp() |
| 578 | app.log = logging.getLogger() |
| 579 | name = "config.py" |
| 580 | with TemporaryDirectory() as td: |
| 581 | with open(pjoin(td, name), "w") as f: |
| 582 | f.write("syntax error()") |
| 583 | with self.assertLogs(app.log, logging.ERROR) as captured: |
| 584 | app.load_config_file(name, path=[td]) |
| 585 | output = "\n".join(captured.output) |
| 586 | self.assertIn("SyntaxError", output) |
| 587 | |
| 588 | def test_raise_on_bad_config(self): |
| 589 | app = MyApp() |
nothing calls this directly
no test coverage detected