From 7ff8127ced86e4d74039d133af178ec95b7d9937 Mon Sep 17 00:00:00 2001 From: lukas leufen <l.leufen@fz-juelich.de> Date: Mon, 18 Nov 2019 14:41:57 +0100 Subject: [PATCH] move mock into if statement --- test/test_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_helpers.py b/test/test_helpers.py index 2d0a0209..25942371 100644 --- a/test/test_helpers.py +++ b/test/test_helpers.py @@ -168,8 +168,8 @@ class TestPrepareHost: with pytest.raises(OSError) as e: prepare_host() 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(): + mock_host.return_value = "linux-gzsx" with pytest.raises(NotADirectoryError) as e: prepare_host() assert "does not exist for host 'linux-gzsx'" in e.value.args[0] -- GitLab