MCPcopy Create free account
hub / github.com/ipython/traitlets / test_log_bad_config

Method test_log_bad_config

tests/config/test_application.py:576–586  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 2

load_config_fileMethod · 0.80
MyAppClass · 0.70

Tested by

no test coverage detected