Skip to content

Commit

Permalink
Remove unused mock validate_active_realizations_count-method in tests…
Browse files Browse the repository at this point in the history
… for runmodel
  • Loading branch information
jonathan-eq committed Dec 10, 2024
1 parent 2e604fc commit ae94407
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions tests/ert/unit_tests/run_models/test_base_run_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def patch_abstractmethods(monkeypatch):


def test_base_run_model_supports_restart(minimum_case):
BaseRunModel.validate_active_realizations_count = MagicMock()
brm = BaseRunModel(minimum_case, None, None, minimum_case.queue_config, [True])
assert brm.support_restart

Expand All @@ -41,7 +40,6 @@ def __init__(self, status):
],
)
def test_active_realizations(initials):
BaseRunModel.validate_active_realizations_count = MagicMock()
brm = BaseRunModel(MagicMock(), None, None, None, initials)
brm._initial_realizations_mask = initials
assert brm.ensemble_size == len(initials)
Expand All @@ -61,7 +59,6 @@ def test_active_realizations(initials):
],
)
def test_failed_realizations(initials, completed, any_failed, failures):
BaseRunModel.validate_active_realizations_count = MagicMock()
brm = BaseRunModel(MagicMock(), None, None, None, initials)
brm._initial_realizations_mask = initials
brm._completed_realizations_mask = completed
Expand Down Expand Up @@ -183,7 +180,7 @@ def test_num_cpu_is_propagated_from_config_to_ensemble(run_args):
# Given NUM_CPU in the config file has a special value
config = ErtConfig.from_file_contents("NUM_REALIZATIONS 2\nNUM_CPU 42")
# Set up a BaseRunModel object from the config above:
BaseRunModel.validate_active_realizations_count = MagicMock()

brm = BaseRunModel(
config=config,
storage=MagicMock(spec=Storage),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def get_run_path_mock(realizations, iteration=None):
return [f"out/realization-{r}/iter-{iteration}" for r in realizations]
return [f"out/realization-{r}" for r in realizations]

EnsembleExperiment.validate_active_realizations_count = MagicMock()
EnsembleExperiment.validate_successful_realizations_count = MagicMock()
ensemble_experiment = EnsembleExperiment(
*[MagicMock()] * 2 + [active_mask, MagicMock(), None] + [MagicMock()] * 4
Expand Down

0 comments on commit ae94407

Please sign in to comment.