Skip to content

Commit 1a27821

Browse files
committed
🧪 TEST: fix and add a CLI returncode test
1 parent 4905dd5 commit 1a27821

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/test_cli.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@
22
import tempfile
33
from unittest.mock import patch
44

5+
import pytest
6+
57
from markdown_it.cli import parse
68

79

810
def test_parse():
911
with tempfile.TemporaryDirectory() as tempdir:
1012
path = pathlib.Path(tempdir).joinpath("test.md")
1113
path.write_text("a b c")
12-
assert parse.main([str(path)])
14+
assert parse.main([str(path)]) == 0
15+
16+
17+
def test_parse_fail():
18+
with pytest.raises(SystemExit):
19+
assert parse.main(["/tmp/nonexistant_path/for_cli_test.md"]) == 1
1320

1421

1522
def test_print_heading():

0 commit comments

Comments
 (0)