Skip to content

Commit

Permalink
Reduce copying of test-data
Browse files Browse the repository at this point in the history
  • Loading branch information
frode-aarstad committed Nov 22, 2024
1 parent 7fdabc1 commit 2533db3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/everest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def copy_test_data_to_tmp(tmp_path, monkeypatch):
@pytest.fixture
def copy_snake_oil_to_tmp(tmp_path, monkeypatch):
path = relpath("test_data", "snake_oil")
shutil.copytree(path, tmp_path, dirs_exist_ok=True)
shutil.copytree(path, tmp_path / "snake_oil", dirs_exist_ok=True)
monkeypatch.chdir(tmp_path)


Expand Down
2 changes: 1 addition & 1 deletion tests/everest/test_fm_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def register_plugin_hooks(*plugins) -> MockPluginManager:
def test_everest_models_jobs(copy_snake_oil_to_tmp):
everest_models = pytest.importorskip("everest_models")
ert_config = everest_to_ert_config(
EverestConfig.load_file("everest/model/snake_oil.yml")
EverestConfig.load_file("snake_oil/everest/model/snake_oil.yml")
)

jobs = everest_models.forward_models.get_forward_models()
Expand Down
12 changes: 6 additions & 6 deletions tests/everest/test_res_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def build_tutorial_dict(config_dir, output_dir):
}


def test_snake_everest_to_ert(copy_test_data_to_tmp):
def test_snake_everest_to_ert(copy_snake_oil_to_tmp):
# Load config file
ever_config_dict = EverestConfig.load_file(SNAKE_CONFIG_PATH)

Expand Down Expand Up @@ -610,7 +610,7 @@ def test_install_data_with_invalid_templates(
assert expected_error_msg in str(exc_info.value)


def test_strip_date_job_insertion(copy_test_data_to_tmp):
def test_strip_date_job_insertion(copy_snake_oil_to_tmp):
# Load config file
ever_config = EverestConfig.load_file(SNAKE_CONFIG_PATH)
ever_config.model.report_steps = [
Expand All @@ -628,7 +628,7 @@ def test_strip_date_job_insertion(copy_test_data_to_tmp):
assert snake_dict == ert_config_dict


def test_workflow_job(copy_test_data_to_tmp):
def test_workflow_job(copy_snake_oil_to_tmp):
workflow_jobs = [{"name": "test", "source": "jobs/TEST"}]
ever_config = EverestConfig.load_file(SNAKE_CONFIG_PATH)
ever_config.install_workflow_jobs = workflow_jobs
Expand All @@ -641,7 +641,7 @@ def test_workflow_job(copy_test_data_to_tmp):
)


def test_workflows(copy_test_data_to_tmp):
def test_workflows(copy_snake_oil_to_tmp):
workflow_jobs = [{"name": "test", "source": "jobs/TEST"}]
ever_config = EverestConfig.load_file(SNAKE_CONFIG_PATH)
ever_config.install_workflow_jobs = workflow_jobs
Expand All @@ -659,7 +659,7 @@ def test_workflows(copy_test_data_to_tmp):
assert hooks[0] == ("pre_simulation", "PRE_SIMULATION")


def test_user_config_jobs_precedence(copy_test_data_to_tmp):
def test_user_config_jobs_precedence(copy_snake_oil_to_tmp):
# Load config file
ever_config = EverestConfig.load_file(SNAKE_CONFIG_PATH)
first_job = everest.jobs.script_names[0]
Expand All @@ -677,7 +677,7 @@ def test_user_config_jobs_precedence(copy_test_data_to_tmp):
assert job[0][1] == os.path.join(config_dir, "expected_source")


def test_user_config_num_cpu(copy_test_data_to_tmp):
def test_user_config_num_cpu(copy_snake_oil_to_tmp):
# Load config file
ever_config = EverestConfig.load_file(SNAKE_CONFIG_PATH)

Expand Down
2 changes: 1 addition & 1 deletion tests/everest/test_yaml_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@pytest.mark.integration_test
def test_default_seed(copy_test_data_to_tmp, monkeypatch):
def test_default_seed(copy_snake_oil_to_tmp, monkeypatch):
monkeypatch.chdir("snake_oil")
config_file = os.path.join("everest/model", "snake_oil_all.yml")

Expand Down

0 comments on commit 2533db3

Please sign in to comment.