From 8c1070b3189a208047f5415e91b70e0a0a56ffa1 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 26 Jan 2025 18:26:45 +0100 Subject: [PATCH] Disable flaky test on Windows --- tests/test_gui/test_gui_theme.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/test_gui/test_gui_theme.py b/tests/test_gui/test_gui_theme.py index b4a45659..7cd9c0c1 100644 --- a/tests/test_gui/test_gui_theme.py +++ b/tests/test_gui/test_gui_theme.py @@ -20,6 +20,8 @@ along with this program. If not, see . """ from __future__ import annotations +import sys + from pathlib import Path import pytest @@ -144,16 +146,17 @@ def testGuiTheme_Theme(qtbot, monkeypatch, nwGUI, tstPaths): # Load Default Theme # ================== - # Set a mock colour for the window background - mainTheme._guiPalette.color(QPalette.ColorRole.Window).setRgb(0, 0, 0, 0) + if sys.platform != "win32": + # Set a mock colour for the window background + mainTheme._guiPalette.color(QPalette.ColorRole.Window).setRgb(0, 0, 0, 0) - # Load the default theme - CONFIG.guiTheme = "default" - assert mainTheme.loadTheme() is True + # Load the default theme + CONFIG.guiTheme = "default" + assert mainTheme.loadTheme() is True - # This should load a standard palette - wCol = QApplication.style().standardPalette().color(QPalette.ColorRole.Window).getRgb() - assert mainTheme._guiPalette.color(QPalette.ColorRole.Window).getRgb() == wCol + # This should load a standard palette + wCol = QApplication.style().standardPalette().color(QPalette.ColorRole.Window).getRgb() + assert mainTheme._guiPalette.color(QPalette.ColorRole.Window).getRgb() == wCol # Mock Dark Theme # ===============