diff --git a/tests/ert/unit_tests/gui/simulation/test_run_dialog.py b/tests/ert/unit_tests/gui/simulation/test_run_dialog.py index 52578a8b910..6548032e3a5 100644 --- a/tests/ert/unit_tests/gui/simulation/test_run_dialog.py +++ b/tests/ert/unit_tests/gui/simulation/test_run_dialog.py @@ -1,4 +1,5 @@ import os +from pathlib import Path from queue import SimpleQueue from unittest.mock import MagicMock, Mock, patch @@ -17,7 +18,7 @@ ) import ert -from ert.config import ErtConfig +from ert.config import DesignMatrix, ErtConfig from ert.ensemble_evaluator import state from ert.ensemble_evaluator.event import ( EndEvent, @@ -720,14 +721,15 @@ def test_that_stdout_and_stderr_buttons_react_to_file_content( def test_that_design_matrix_show_parameters_button( design_matrix_entry, qtbot: QtBot, storage ): - with open("design_matrix.xlsx", "w", encoding="utf-8"): + xls_filename = "design_matrix.xls" + with open(f"{xls_filename}", "w", encoding="utf-8"): pass config_file = "minimal_config.ert" with open(config_file, "w", encoding="utf-8") as f: f.write("NUM_REALIZATIONS 1") if design_matrix_entry: f.write( - "\nDESIGN_MATRIX design_matrix.xlsx DESIGN_SHEET:DesignSheet01 DEFAULT_SHEET:DefaultValues" + f"\nDESIGN_MATRIX {xls_filename} DESIGN_SHEET:DesignSheet01 DEFAULT_SHEET:DefaultValues" ) args_mock = Mock() @@ -754,8 +756,7 @@ def test_that_design_matrix_show_parameters_button( assert show_dm_parameters.isEnabled() == design_matrix_entry if show_dm_parameters.isEnabled(): design_matrix_df = pd.DataFrame({"a": [1, 2, 3], "b": [3, 4, 5]}) - filename = "design_matrix.xlsl" with patch.object( - ert.config.DesignMatrix, "design_matrix_df", design_matrix_df - ), patch.object(ert.config.DesignMatrix, "xlsl_filename", filename): + DesignMatrix, "design_matrix_df", design_matrix_df + ), patch.object(DesignMatrix, "xls_filename", Path(xls_filename)): qtbot.mouseClick(show_dm_parameters, Qt.LeftButton)