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

Function test_cli_multi_scalar

tests/config/test_application.py:673–687  ·  view source on GitHub ↗
(caplog)

Source from the content-addressed store, hash-verified

671
672
673def test_cli_multi_scalar(caplog):
674 class App(Application):
675 aliases = {"opt": "App.opt"}
676 opt = Unicode(config=True)
677
678 app = App(log=logging.getLogger())
679 with pytest.raises(SystemExit):
680 app.parse_command_line(["--opt", "1", "--opt", "2"])
681 record = caplog.get_records("call")[-1]
682 message = record.message
683
684 assert "Error loading argument" in message
685 assert "App.opt=['1', '2']" in message
686 assert "opt only accepts one value" in message
687 assert record.levelno == logging.CRITICAL
688
689
690class Root(Application):

Callers

nothing calls this directly

Calls 2

parse_command_lineMethod · 0.80
AppClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…