Skip to content

Commit

Permalink
Add test for json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreso committed Sep 5, 2024
1 parent d49d66a commit 2b5dcdc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/unit_tests/config/test_ert_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import pytest
from hypothesis import assume, given, settings
from hypothesis import strategies as st
from pydantic import RootModel, ValidationError
from pydantic import RootModel, TypeAdapter, ValidationError

from ert.config import AnalysisConfig, ConfigValidationError, ErtConfig, HookRuntime
from ert.config.ert_config import site_config_location
Expand Down Expand Up @@ -534,6 +534,9 @@ def test_that_ert_config_is_serializable(tmp_path_factory, config_generator):
assert from_json == ert_config


def test_that_ert_config_has_valid_schema():
TypeAdapter.json_schema(ErtConfig)

@pytest.mark.filterwarnings("ignore::ert.config.ConfigWarning")
@pytest.mark.usefixtures("set_site_config")
@settings(max_examples=10)
Expand Down

0 comments on commit 2b5dcdc

Please sign in to comment.