diff --git a/tests/test_config.py b/tests/test_config.py index 597a5e67..9f047657 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -175,6 +175,14 @@ def test_cmd_line(): app = NoConfigApp() assert app.cfg.preload_app + +def test_cmd_line_invalid_setting(capsys): + with AltArgs(["prog_name", "-q", "bar"]): + with pytest.raises(SystemExit): + NoConfigApp() + _, err = capsys.readouterr() + assert "error: unrecognized arguments: -q" in err + def test_app_config(): with AltArgs(): app = NoConfigApp()