diff --git a/tests/conftest.py b/tests/conftest.py index e4f83281242..e9e22998c85 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -412,6 +412,17 @@ def snake_oil_default_storage(snake_oil_case_storage): yield storage.get_ensemble_by_name("default_0") +@pytest.fixture(scope="session") +def block_storage_path(source_root): + path = source_root / "test-data/block_storage/snake_oil" + if not path.is_dir(): + pytest.skip( + "'test-data/block_storage' has not been checked out.\n" + "Run: git submodule update --init --recursive" + ) + return path.parent + + @pytest.fixture(autouse=True) def no_cert_in_test(monkeypatch): # Do not generate certificates during test, parts of it can be time diff --git a/tests/integration_tests/test_storage_migration.py b/tests/integration_tests/test_storage_migration.py index 3da74cb781e..f8df6db6f63 100644 --- a/tests/integration_tests/test_storage_migration.py +++ b/tests/integration_tests/test_storage_migration.py @@ -1,5 +1,4 @@ import shutil -from pathlib import Path import numpy as np @@ -8,9 +7,9 @@ from ert.storage.local_storage import local_storage_set_ert_config -def test_that_storage_matches(tmp_path, source_root, snapshot, monkeypatch): +def test_that_storage_matches(tmp_path, block_storage_path, snapshot, monkeypatch): shutil.copytree( - Path(source_root) / "test-data/block_storage/all_data_types/", + block_storage_path / "all_data_types/", tmp_path / "all_data_types", ) monkeypatch.chdir(tmp_path / "all_data_types") diff --git a/tests/unit_tests/storage/migration/conftest.py b/tests/unit_tests/storage/migration/conftest.py deleted file mode 100644 index d36b1d265e0..00000000000 --- a/tests/unit_tests/storage/migration/conftest.py +++ /dev/null @@ -1,12 +0,0 @@ -import pytest - - -@pytest.fixture(scope="session") -def block_storage_path(source_root): - path = source_root / "test-data/block_storage/snake_oil" - if not path.is_dir(): - pytest.skip( - "'test-data/block_storage' has not been checked out.\n" - "Run: git submodule update --init --recursive" - ) - return path.parent