Skip to content

Commit 0a6bf58

Browse files
committed
Remove snapshot marker from non-snapshot tests
The term snapshot test should be reserved for tests utilizing pytest-snapshot. These two tests do not, so name and mark them differently and better
1 parent 7aa972d commit 0a6bf58

1 file changed

Lines changed: 8 additions & 17 deletions

File tree

tests/ert/unit_tests/analysis/test_es_update.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -318,16 +318,15 @@ def test_update_handles_precision_loss_in_std_dev(tmp_path):
318318
)
319319

320320

321-
@pytest.mark.snapshot_test
322321
@pytest.mark.filterwarnings("ignore:Config contains a SUMMARY key but no forward")
323-
@pytest.mark.slow
324-
def test_update_snapshot(
322+
@pytest.mark.slow # This test is slow when snake_oil is not in cache
323+
def test_that_posterior_gen_kw_values_match_expected_on_snake_oil(
325324
snake_oil_case_storage,
326325
snake_oil_storage,
327326
):
328327
"""
329-
Note that this is now a snapshot test, so there is no guarantee that the
330-
snapshots are correct, they are just documenting the current behavior.
328+
There is no guarantee that the expected GEN_KW values are correct,
329+
they are just documenting the current behavior.
331330
"""
332331
expected_gen_kw = [
333332
0.3583003662668918,
@@ -385,7 +384,6 @@ def test_update_snapshot(
385384
assert target_gen_kw == pytest.approx(expected_gen_kw, abs=1e-5)
386385

387386

388-
@pytest.mark.snapshot_test
389387
@pytest.mark.usefixtures("use_tmpdir")
390388
@pytest.mark.parametrize(
391389
("alpha", "expected", "expectation"),
@@ -425,16 +423,9 @@ def test_update_snapshot(
425423
),
426424
],
427425
)
428-
def test_smoother_snapshot_alpha(
426+
def test_that_alpha_can_be_used_for_outlier_detection(
429427
alpha, expected, storage, uniform_parameter, obs, expectation
430428
):
431-
"""
432-
Note that this is now a snapshot test, so there is no guarantee that the
433-
snapshots are correct, they are just documenting the current behavior.
434-
"""
435-
436-
# alpha is a parameter used for outlier detection
437-
438429
response_config = GenDataConfig(keys=["RESPONSE"]).model_dump(mode="json")
439430
experiment = storage.create_experiment(
440431
name="ensemble_smoother",
@@ -493,7 +484,7 @@ def test_smoother_snapshot_alpha(
493484
enkf_truncation=es_settings.enkf_truncation,
494485
rng=rng,
495486
)
496-
result_snapshot = smoother_update(
487+
posterior_update = smoother_update(
497488
prior_storage,
498489
posterior_storage,
499490
observations=["OBSERVATION"],
@@ -502,9 +493,9 @@ def test_smoother_snapshot_alpha(
502493
),
503494
strategy_map=strategy_map,
504495
)
505-
assert result_snapshot.alpha == alpha
496+
assert posterior_update.alpha == alpha
506497
assert (
507-
result_snapshot.observations_and_responses["status"].to_list() == expected
498+
posterior_update.observations_and_responses["status"].to_list() == expected
508499
)
509500

510501

0 commit comments

Comments
 (0)