Skip to content
50 changes: 0 additions & 50 deletions tests/integration/test_diagnostic_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
from pathlib import Path
from textwrap import dedent

import esmvalcore
import pytest
import yaml
from esmvalcore._main import run
from packaging import version


def write_config_file(dirname):
Expand Down Expand Up @@ -73,54 +71,6 @@ def check(result_file):
]


@pytest.mark.skipif(
version.parse(esmvalcore.__version__) >= version.parse("2.14.0"),
reason="ESMValCore >= v2.14.0",
)
@pytest.mark.installation
@pytest.mark.parametrize("script_file", SCRIPTS)
def test_diagnostic_run_config_file(tmp_path, script_file):
local_script_file = Path(__file__).parent / script_file

recipe_file = tmp_path / "recipe_test.yml"
script_file = tmp_path / script_file
result_file = tmp_path / "result.yml"

shutil.copy(local_script_file, script_file)

# Create recipe
recipe = dedent(f"""
documentation:
title: Test recipe
description: Recipe with no data.
authors: [andela_bouwe]

diagnostics:
diagnostic_name:
scripts:
script_name:
script: {script_file}
setting_name: {result_file}
""")
recipe_file.write_text(str(recipe))

config_file = write_config_file(tmp_path)
with arguments(
"esmvaltool",
"run",
"--config_file",
config_file,
str(recipe_file),
):
run()

check(result_file)


@pytest.mark.skipif(
version.parse(esmvalcore.__version__) < version.parse("2.12.0"),
reason="ESMValCore < v2.12.0",
)
@pytest.mark.installation
@pytest.mark.parametrize("script_file", SCRIPTS)
def test_diagnostic_run(tmp_path, script_file):
Expand Down