Skip to content

Commit 2bf26d1

Browse files
committed
test: assert version appears in --version output
1 parent 2bb4036 commit 2bf26d1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/test_main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from fixtures import exefile
1919

2020
import floss.main
21+
from floss.version import __version__
2122

2223

2324
def test_main_help(capsys):
@@ -38,11 +39,13 @@ def test_main_help(capsys):
3839
assert "--json" in out
3940

4041

41-
def test_main_version():
42+
def test_main_version(capsys):
4243
with pytest.raises(SystemExit) as pytest_wrapped_e:
4344
floss.main.main(["--version"])
4445
assert pytest_wrapped_e.type == SystemExit
4546
assert pytest_wrapped_e.value.code == 0
47+
out = capsys.readouterr().out
48+
assert __version__ in out
4649

4750

4851
def test_main(exefile):

0 commit comments

Comments
 (0)