Skip to content
Snippets Groups Projects
Commit 7ff8127c authored by lukas leufen's avatar lukas leufen
Browse files

move mock into if statement

parent 5c778fc6
No related branches found
No related tags found
3 merge requests!17update to v0.4.0,!15new feat split subsets,!13fix bug make tests running
Pipeline #26151 passed
...@@ -168,8 +168,8 @@ class TestPrepareHost: ...@@ -168,8 +168,8 @@ class TestPrepareHost:
with pytest.raises(OSError) as e: with pytest.raises(OSError) as e:
prepare_host() prepare_host()
assert "unknown host 'NotExistingHostName'" in e.value.args[0] assert "unknown host 'NotExistingHostName'" in e.value.args[0]
mock_host.return_value = "linux-gzsx"
if "runner-6HmDp9Qd-project-2411-concurrent" not in socket.gethostname(): if "runner-6HmDp9Qd-project-2411-concurrent" not in socket.gethostname():
mock_host.return_value = "linux-gzsx"
with pytest.raises(NotADirectoryError) as e: with pytest.raises(NotADirectoryError) as e:
prepare_host() prepare_host()
assert "does not exist for host 'linux-gzsx'" in e.value.args[0] assert "does not exist for host 'linux-gzsx'" in e.value.args[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment