diff --git a/examples/error.toml b/examples/error.toml new file mode 100644 index 0000000..37c61f9 --- /dev/null +++ b/examples/error.toml @@ -0,0 +1,4 @@ +name = "error example" + +[tasks.a] +command = "undefined command" diff --git a/tests/test_e2e.py b/tests/test_e2e.py index 8f1554a..7968ab8 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -18,6 +18,16 @@ def test_cli(config_path: str): assert result.exit_code == 0, f"Exit code was {result.exit_code}, expected 0. Error: {result.exc_info}" +def test_cli_error(): + from typer.testing import CliRunner + + from nanoflow.__main__ import app + + runner = CliRunner() + result = runner.invoke(app, ["./examples/error.toml"]) + assert result.exit_code != 0 + + @pytest.mark.asyncio async def test_tui(): import toml