From f0fb2aab72e13ce745b98a7aeafb278284df1f3a Mon Sep 17 00:00:00 2001 From: Feda Curic Date: Fri, 30 Aug 2024 14:14:05 +0200 Subject: [PATCH] Set ensemble name of single test run to "ensemble" No reason to use date as name. Makes writing tests easier. --- src/ert/gui/simulation/single_test_run_panel.py | 4 +--- tests/unit_tests/gui/test_single_test_run.py | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ert/gui/simulation/single_test_run_panel.py b/src/ert/gui/simulation/single_test_run_panel.py index f74d3edfd65..23ecc40490a 100644 --- a/src/ert/gui/simulation/single_test_run_panel.py +++ b/src/ert/gui/simulation/single_test_run_panel.py @@ -1,5 +1,4 @@ from dataclasses import dataclass -from datetime import datetime from qtpy import QtCore from qtpy.QtWidgets import QFormLayout, QLabel @@ -37,5 +36,4 @@ def __init__(self, run_path: str, notifier: ErtNotifier): self.setLayout(layout) def get_experiment_arguments(self) -> Arguments: - ensemble_name = f"{datetime.now().strftime('%Y-%m-%dT%H%M')}" - return Arguments(TEST_RUN_MODE, ensemble_name, "single_test_run") + return Arguments(TEST_RUN_MODE, "ensemble", "single_test_run") diff --git a/tests/unit_tests/gui/test_single_test_run.py b/tests/unit_tests/gui/test_single_test_run.py index 08b1022222d..b13fa7a86ff 100644 --- a/tests/unit_tests/gui/test_single_test_run.py +++ b/tests/unit_tests/gui/test_single_test_run.py @@ -1,6 +1,5 @@ import contextlib import shutil -from datetime import datetime from qtpy.QtCore import Qt from qtpy.QtWidgets import ( @@ -38,4 +37,7 @@ def test_single_test_run_after_ensemble_experiment( storage = gui.notifier.storage assert "single_test_run" in [exp.name for exp in storage.experiments] - assert any(str(datetime.now().year) in ens.name for ens in storage.ensembles) + ensemble_names = [ens.name for ens in storage.ensembles] + assert "iter-0" in ensemble_names + # Default ensemble name when running single test run + assert "ensemble" in ensemble_names