https://github.com/ESMValGroup/ESMValTool
Raw File
Tip revision: 3477e494a860d95a30c6a2c7e2f05ec2795485e8 authored by Jon Lillis on 10 November 2021, 16:59:09 UTC
First demonstration of prototype recipe test
Tip revision: 3477e49
test_recipes.py
"""Test script to compare the output of ESMValTool against previous runs."""

import pytest

from .esmvaltool_testlib import RECIPES, ESMValToolTest


@pytest.mark.parametrize("recipe", RECIPES)
def test_recipe(tmpdir, recipe):  # noqa
    """Create a test for each recipe in RECIPES and run those."""
    test = ESMValToolTest(
        recipe=recipe,
        output_directory=str(tmpdir),
        ignore=['tmp/*/*', '*log*.txt', '*.log'],
        checksum_exclude=['pdf', 'ps', 'png', 'eps', 'epsi', 'nc'])

    test.run(graphics=None,
             files='all',
             check_size_gt_zero=True,
             checksum_files='all',
             check_file_content=['nc'])

    assert test.success
back to top