Skip to content

Commit

Permalink
✅ test: add tests for error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
zrr1999 committed Oct 20, 2024
1 parent 42603ac commit 181f540
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/error.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "error example"

[tasks.a]
command = "undefined command"
10 changes: 10 additions & 0 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 181f540

Please sign in to comment.