Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions tests/sample_data/experimental/test_run_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import iris
import pytest

from esmvalcore.config._config_object import CFG_DEFAULT
from esmvalcore.config._diagnostics import TAGS
from esmvalcore.exceptions import RecipeError
from esmvalcore.experimental import CFG, Recipe, get_recipe
Expand All @@ -19,10 +20,6 @@

esmvaltool_sample_data = pytest.importorskip("esmvaltool_sample_data")

CFG.update(esmvaltool_sample_data.get_rootpaths())
CFG['drs']['CMIP6'] = 'SYNDA'
CFG['max_parallel_tasks'] = 1
CFG['remove_preproc_dir'] = False

AUTHOR_TAGS = {
'authors': {
Expand Down Expand Up @@ -50,12 +47,17 @@ def test_run_recipe(task, recipe, tmp_path):
"""
TAGS.set_tag_values(AUTHOR_TAGS)

CFG['output_dir'] = tmp_path

assert isinstance(recipe, Recipe)
assert isinstance(recipe._repr_html_(), str)

session = CFG.start_session(recipe.path.stem)
session.clear()
session.update(CFG_DEFAULT)
session['output_dir'] = tmp_path / 'esmvaltool_output'
session.update(esmvaltool_sample_data.get_rootpaths())
session['drs'] = {'CMIP6': 'SYNDA'}
session['max_parallel_tasks'] = 1
session['remove_preproc_dir'] = False

output = recipe.run(task=task, session=session)

Expand Down