Skip to content

Commit

Permalink
Adds teardown to avoid flaky tests with run_dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustoMagalhaes authored and eivindjahren committed Nov 25, 2024
1 parent bd0538e commit 3a8ffd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/ert/unit_tests/gui/simulation/test_run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def notifier():
def run_dialog(qtbot: QtBot, run_model, event_queue, notifier):
run_dialog = RunDialog("mock.ert", run_model, event_queue, notifier)
qtbot.addWidget(run_dialog)
return run_dialog

# Teardown
yield run_dialog
run_dialog.close()


def test_terminating_experiment_shows_a_confirmation_dialog(
Expand Down Expand Up @@ -102,7 +105,6 @@ def test_run_dialog_polls_run_model_for_runtime(
)
event_queue.put(EndEvent(failed=False, msg=""))
qtbot.waitUntil(lambda: run_dialog.is_simulation_done() == True)
run_dialog.close()


def test_large_snapshot(
Expand Down Expand Up @@ -590,7 +592,6 @@ def handle_error_dialog(run_dialog):

QTimer.singleShot(100, lambda: handle_error_dialog(run_dialog))
qtbot.waitUntil(lambda: run_dialog.is_simulation_done() == True, timeout=100000)
run_dialog.close()


@pytest.mark.integration_test
Expand Down

0 comments on commit 3a8ffd8

Please sign in to comment.