Skip to content

Commit ad0f0ea

Browse files
committed
Keep track of already open windows
1 parent 6e16e43 commit ad0f0ea

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/ert/ui_tests/gui/test_main_window.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,8 @@ def test_right_click_plot_button_opens_external_plotter(qtbot, storage, monkeypa
616616
plot_window = wait_for_child(gui, qtbot, PlotWindow)
617617
assert plot_window
618618

619+
prev_open_windows = len(QApplication.topLevelWindows())
620+
619621
def detect_external_plot_widget_open_on_right_click(plot_count: int):
620622
previous_count = plot_count - 1
621623
assert len(QApplication.topLevelWindows()) == previous_count
@@ -626,9 +628,9 @@ def detect_external_plot_widget_open_on_right_click(plot_count: int):
626628
)
627629
assert len(QApplication.topLevelWindows()) == plot_count
628630

629-
detect_external_plot_widget_open_on_right_click(1)
630-
detect_external_plot_widget_open_on_right_click(2)
631-
detect_external_plot_widget_open_on_right_click(3)
631+
detect_external_plot_widget_open_on_right_click(prev_open_windows + 1)
632+
detect_external_plot_widget_open_on_right_click(prev_open_windows + 2)
633+
detect_external_plot_widget_open_on_right_click(prev_open_windows + 3)
632634
gui.close()
633635

634636

0 commit comments

Comments
 (0)