Try to fix capsys issue with Python 3.8

This commit is contained in:
grossmj
2020-06-16 20:56:10 +09:30
parent d33584a2e4
commit 241caa1ec7
3 changed files with 8 additions and 7 deletions

View File

@ -50,23 +50,23 @@ def test_parse_arguments(capsys, tmpdir):
with pytest.raises(SystemExit):
run.parse_arguments(["-v"])
out, err = capsys.readouterr()
assert __version__ in "{}{}".format(out.strip(), err.strip()) # Depending of the Python version the location of the version change
out, _ = capsys.readouterr()
assert __version__ in "{}".format(out.strip()) # Depending of the Python version the location of the version change
with pytest.raises(SystemExit):
run.parse_arguments(["--version"])
out, err = capsys.readouterr()
assert __version__ in "{}{}".format(out.strip(), err.strip()) # Depending of the Python version the location of the version change
out, _ = capsys.readouterr()
assert __version__ in "{}".format(out.strip()) # Depending of the Python version the location of the version change
with pytest.raises(SystemExit):
run.parse_arguments(["-h"])
out, err = capsys.readouterr()
out, _ = capsys.readouterr()
assert __version__ in out
assert "optional arguments" in out
with pytest.raises(SystemExit):
run.parse_arguments(["--help"])
out, err = capsys.readouterr()
out, _ = capsys.readouterr()
assert __version__ in out
assert "optional arguments" in out