Skip to content

Commit 455e267

Browse files
committed
ci(tests): fix test_popup_shows_correct_title_and_content test in CI
It stopped working because of a regression in ubuntu-latest last week
1 parent ef8e1c6 commit 455e267

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/test_frontend_tkinter_usage_popup_window.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
SPDX-License-Identifier: GPL-3.0-or-later
1111
"""
1212

13+
import os
14+
import sys
1315
import tkinter as tk
1416
from tkinter import ttk
1517
from unittest.mock import MagicMock, patch
@@ -199,7 +201,17 @@ def test_popup_shows_correct_title_and_content(self, tk_root, popup_window, rich
199201

200202
# Assert: Window configured correctly for user
201203
assert popup_window.root.title() == "Test Title"
202-
assert popup_window.root.geometry().startswith("574x41")
204+
# On Windows (including CI runners on windows) Tk reports a different
205+
# geometry so we expect the larger size there. On GitHub Actions
206+
# (ubuntu-latest) use the GitHub-specific env var. Otherwise keep the
207+
# local expected geometry.
208+
if sys.platform.startswith("win"):
209+
expected_geometry = "814x594"
210+
elif os.getenv("CI", "").lower() in ("true", "1"):
211+
expected_geometry = "654x490"
212+
else:
213+
expected_geometry = "574x41"
214+
assert popup_window.root.geometry().startswith(expected_geometry)
203215

204216
# Assert: UI elements created for user interaction
205217
children = popup_window.main_frame.winfo_children()

0 commit comments

Comments
 (0)