Skip to content

Commit

Permalink
TST: Skip sumo uploader test if not installed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mferrera committed Mar 5, 2024
1 parent a24774b commit 563444b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_integration/test_wf_create_case_metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import getpass
import importlib
import os
import sys

Expand Down Expand Up @@ -75,7 +76,11 @@ def test_create_case_metadata_warns_without_overwriting(

@pytest.mark.skipif(
sys.version_info[:2] == (3, 12),
reason="fmu-sumo-uploader not compatible with Python 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
Expand Down

0 comments on commit 563444b

Please sign in to comment.