Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Oct 2, 2024
1 parent 14cf5cd commit 739523d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/ert/config/ert_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,19 @@ def from_dict(cls, config_dict) -> Self:
config_dict[ConfigKeys.SUMMARY] = [summary_keys] + [
[key] for key in summary_obs if key not in summary_keys
]
if model_config:
observations = cls._create_observations(
obs_config_content,
ensemble_config,
model_config.time_map,
model_config.history_source,
)
else:
observations = None
errors.append(
ConfigValidationError(
"Not possible to validate observations without valid model config"
)
)
except ConfigValidationError as err:
errors.append(err)

Expand Down
6 changes: 3 additions & 3 deletions tests/ert/unit_tests/config/test_ert_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pytest
from hypothesis import assume, given, settings
from hypothesis import strategies as st
from pydantic import RootModel, TypeAdapter, ValidationError
from pydantic import RootModel, TypeAdapter

from ert.config import AnalysisConfig, ConfigValidationError, ErtConfig, HookRuntime
from ert.config.ert_config import site_config_location
Expand Down Expand Up @@ -1469,7 +1469,7 @@ def test_no_timemap_or_refcase_provides_clear_error():
print(line, end="")

with pytest.raises(
ValidationError,
ConfigValidationError,
match="Missing REFCASE or TIME_MAP for observations: WPR_DIFF_1",
):
ErtConfig.from_file("snake_oil.ert")
Expand Down Expand Up @@ -1510,7 +1510,7 @@ def test_that_multiple_errors_are_shown_when_generating_observations():
continue
print(line, end="")

with pytest.raises(ValidationError) as err:
with pytest.raises(ConfigValidationError) as err:
_ = ErtConfig.from_file("snake_oil.ert")

expected_errors = [
Expand Down

0 comments on commit 739523d

Please sign in to comment.