Disable flaky test on Windows

This commit is contained in:
Veronica Berglyd Olsen
2025-01-26 18:26:45 +01:00
parent 6c4d8f3ede
commit 8c1070b318
+11 -8
View File
@@ -20,6 +20,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
""" """
from __future__ import annotations from __future__ import annotations
import sys
from pathlib import Path from pathlib import Path
import pytest import pytest
@@ -144,16 +146,17 @@ def testGuiTheme_Theme(qtbot, monkeypatch, nwGUI, tstPaths):
# Load Default Theme # Load Default Theme
# ================== # ==================
# Set a mock colour for the window background if sys.platform != "win32":
mainTheme._guiPalette.color(QPalette.ColorRole.Window).setRgb(0, 0, 0, 0) # Set a mock colour for the window background
mainTheme._guiPalette.color(QPalette.ColorRole.Window).setRgb(0, 0, 0, 0)
# Load the default theme # Load the default theme
CONFIG.guiTheme = "default" CONFIG.guiTheme = "default"
assert mainTheme.loadTheme() is True assert mainTheme.loadTheme() is True
# This should load a standard palette # This should load a standard palette
wCol = QApplication.style().standardPalette().color(QPalette.ColorRole.Window).getRgb() wCol = QApplication.style().standardPalette().color(QPalette.ColorRole.Window).getRgb()
assert mainTheme._guiPalette.color(QPalette.ColorRole.Window).getRgb() == wCol assert mainTheme._guiPalette.color(QPalette.ColorRole.Window).getRgb() == wCol
# Mock Dark Theme # Mock Dark Theme
# =============== # ===============