Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compute_endpoint/tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def pytest_configure(config):
config.addinivalue_line(
"markers", "no_mock_pim: In test_endpointmanager_unit, disable autouse fixture"
)
config.addinivalue_line(
"markers", "no_mock_shutil: In test_endpointmanager_unit, disable autouse"
)


known_user_config_opts = {
Expand Down
12 changes: 12 additions & 0 deletions compute_endpoint/tests/unit/test_endpointmanager_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,17 @@ def mock_pim(request):
yield mock_pim


@pytest.fixture(autouse=True)
def shutil_which(request):
if "no_mock_shutil" in request.keywords:
yield
return

with mock.patch("shutil.which") as m:
m.return_value = "/some/path"
yield m


@pytest.fixture
def mock_props():
yield pika.BasicProperties(
Expand Down Expand Up @@ -1709,6 +1720,7 @@ def test_environment_includes_user_versions(
assert urun["globus_compute_sdk_version"] == env["GC_USER_SDK_VERSION"]


@pytest.mark.no_mock_shutil
def test_warns_if_executable_not_found(
mock_log, successful_exec_from_mocked_root, randomstring
):
Expand Down
Loading