Skip to content

Commit

Permalink
Use block storage path fixture in storage test
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreso committed Mar 12, 2024
1 parent 6bac0ba commit ca549c9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions tests/integration_tests/test_storage_migration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import shutil
from pathlib import Path

import numpy as np

Expand All @@ -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")
Expand Down
12 changes: 0 additions & 12 deletions tests/unit_tests/storage/migration/conftest.py

This file was deleted.

0 comments on commit ca549c9

Please sign in to comment.