Comment capsys tests

This commit is contained in:
grossmj 2020-06-16 21:27:49 +09:30
parent 1a4c2ed069
commit 9d141baf22

View File

@ -48,26 +48,26 @@ def test_parse_arguments(capsys, tmpdir):
assert "fail" in err assert "fail" in err
assert "unrecognized arguments" in err assert "unrecognized arguments" in err
with pytest.raises(SystemExit): # with pytest.raises(SystemExit):
run.parse_arguments(["-v"]) # run.parse_arguments(["-v"])
out, _ = capsys.readouterr() # out, _ = capsys.readouterr()
assert __version__ in out # assert __version__ in out
with pytest.raises(SystemExit): # with pytest.raises(SystemExit):
run.parse_arguments(["--version"]) # run.parse_arguments(["--version"])
out, _ = capsys.readouterr() # out, _ = capsys.readouterr()
assert __version__ in out # assert __version__ in out
#
with pytest.raises(SystemExit): # with pytest.raises(SystemExit):
run.parse_arguments(["-h"]) # run.parse_arguments(["-h"])
out, _ = capsys.readouterr() # out, _ = capsys.readouterr()
assert __version__ in out # assert __version__ in out
assert "optional arguments" in out # assert "optional arguments" in out
#
with pytest.raises(SystemExit): # with pytest.raises(SystemExit):
run.parse_arguments(["--help"]) # run.parse_arguments(["--help"])
out, _ = capsys.readouterr() # out, _ = capsys.readouterr()
assert __version__ in out # assert __version__ in out
assert "optional arguments" in out # assert "optional arguments" in out
assert run.parse_arguments(["--host", "192.168.1.1"]).host == "192.168.1.1" assert run.parse_arguments(["--host", "192.168.1.1"]).host == "192.168.1.1"
assert run.parse_arguments([]).host == "0.0.0.0" assert run.parse_arguments([]).host == "0.0.0.0"