Skip to content

Commit 4ca1a8a

Browse files
committed
Reduce some test noise
When running the tests verbosely, a number of the MEP tests run `shutil.which` as a byproduct of testing something else. Mock it out to slightly increase the signal.
1 parent 43cf17b commit 4ca1a8a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

compute_endpoint/tests/unit/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ def pytest_configure(config):
1919
config.addinivalue_line(
2020
"markers", "no_mock_pim: In test_endpointmanager_unit, disable autouse fixture"
2121
)
22+
config.addinivalue_line(
23+
"markers", "no_mock_shutil: In test_endpointmanager_unit, disable autouse"
24+
)
2225

2326

2427
known_user_config_opts = {

compute_endpoint/tests/unit/test_endpointmanager_unit.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,17 @@ def mock_pim(request):
202202
yield mock_pim
203203

204204

205+
@pytest.fixture(autouse=True)
206+
def shutil_which(request):
207+
if "no_mock_shutil" in request.keywords:
208+
yield
209+
return
210+
211+
with mock.patch("shutil.which") as m:
212+
m.return_value = "/some/path"
213+
yield m
214+
215+
205216
@pytest.fixture
206217
def mock_props():
207218
yield pika.BasicProperties(
@@ -1709,6 +1720,7 @@ def test_environment_includes_user_versions(
17091720
assert urun["globus_compute_sdk_version"] == env["GC_USER_SDK_VERSION"]
17101721

17111722

1723+
@pytest.mark.no_mock_shutil
17121724
def test_warns_if_executable_not_found(
17131725
mock_log, successful_exec_from_mocked_root, randomstring
17141726
):

0 commit comments

Comments
 (0)