From 055ef2be26e0d995ef6fba067b514ffbd52396ab Mon Sep 17 00:00:00 2001 From: mferrera Date: Tue, 5 Mar 2024 10:01:57 +0100 Subject: [PATCH] TST: Skip sumo uploader test if not installed We cannot add fmu-sumo-uploader as a dependency, so skip the test if `fmu.sumo` namespace cannot be found. If some other `fmu.sumo` package ends up installed, this fixture may need to be updated with the `.uploader` specificity, but importlib find_spec will error out with that specificity at fmu.sumo before reaching it. --- tests/test_integration/test_wf_create_case_metadata.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_integration/test_wf_create_case_metadata.py b/tests/test_integration/test_wf_create_case_metadata.py index 883ad13b2..8689ddaf9 100644 --- a/tests/test_integration/test_wf_create_case_metadata.py +++ b/tests/test_integration/test_wf_create_case_metadata.py @@ -1,4 +1,5 @@ import getpass +import importlib import os import sys @@ -77,6 +78,10 @@ def test_create_case_metadata_warns_without_overwriting( sys.version_info[:2] == (3, 12), reason="fmu-sumo-uploader not compatible with Python 3.12", ) +@pytest.mark.skipif( + not importlib.util.find_spec("fmu.sumo"), + reason="fmu-sumo-uploader is not installed", +) def test_create_case_metadata_enable_mocked_sumo( fmu_snakeoil_project, monkeypatch, mocker, mock_sumo_uploader ):