Skip to content

Commit

Permalink
Keep track of already open windows
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Nov 11, 2024
1 parent 6e16e43 commit ad0f0ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/ert/ui_tests/gui/test_main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,8 @@ def test_right_click_plot_button_opens_external_plotter(qtbot, storage, monkeypa
plot_window = wait_for_child(gui, qtbot, PlotWindow)
assert plot_window

prev_open_windows = len(QApplication.topLevelWindows())

def detect_external_plot_widget_open_on_right_click(plot_count: int):
previous_count = plot_count - 1
assert len(QApplication.topLevelWindows()) == previous_count
Expand All @@ -626,9 +628,9 @@ def detect_external_plot_widget_open_on_right_click(plot_count: int):
)
assert len(QApplication.topLevelWindows()) == plot_count

detect_external_plot_widget_open_on_right_click(1)
detect_external_plot_widget_open_on_right_click(2)
detect_external_plot_widget_open_on_right_click(3)
detect_external_plot_widget_open_on_right_click(prev_open_windows + 1)
detect_external_plot_widget_open_on_right_click(prev_open_windows + 2)
detect_external_plot_widget_open_on_right_click(prev_open_windows + 3)
gui.close()


Expand Down

0 comments on commit ad0f0ea

Please sign in to comment.