Try to fix capsys issue with Python 3.8

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

No files matched your search

+1
View File
@@ -100,6 +100,7 @@ async def test_auto_start(controller, dummy_gns3vm, dummy_engine):
assert controller.computes["vm"].user == "hello"
assert controller.computes["vm"].password == "world"
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not working well on Windows")
async def test_auto_start_with_error(controller, dummy_gns3vm, dummy_engine):
+6 -6
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