1
0
mirror of https://github.com/venthur/blag.git synced 2025-11-25 12:42:41 +00:00

added version option

This commit is contained in:
Bastian Venthur
2022-06-20 12:30:27 +02:00
parent 7e8f2a5b9a
commit 35f6ef05b6
3 changed files with 20 additions and 0 deletions

View File

@@ -277,3 +277,13 @@ foo bar
def test_main(cleandir):
blag.main(['build'])
def test_cli_version(capsys):
with pytest.raises(SystemExit) as ex:
blag.main(['--version'])
# normal system exit
assert ex.value.code == 0
# proper version reported
out, _ = capsys.readouterr()
assert blag.__VERSION__ in out