(caplog)
| 671 | |
| 672 | |
| 673 | def 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 | |
| 690 | class Root(Application): |
nothing calls this directly
no test coverage detected
searching dependent graphs…