From e0d65b42f418f07993ecaf2dd5dbb84280e4d4f5 Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Thu, 28 Aug 2025 12:47:14 +0200 Subject: [PATCH] test: apply theme on qapp creation --- tests/unit_tests/conftest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit_tests/conftest.py b/tests/unit_tests/conftest.py index db5427dc..e43bd959 100644 --- a/tests/unit_tests/conftest.py +++ b/tests/unit_tests/conftest.py @@ -6,6 +6,7 @@ import numpy as np import pytest from bec_lib import messages from bec_lib.messages import _StoredDataInfo +from bec_qthemes import apply_theme from pytestqt.exceptions import TimeoutError as QtBotTimeoutError from qtpy.QtWidgets import QApplication, QMessageBox @@ -25,6 +26,11 @@ def pytest_runtest_makereport(item, call): @pytest.fixture(autouse=True) def qapplication(qtbot, request, testable_qtimer_class): # pylint: disable=unused-argument + qapp = QApplication.instance() + if not hasattr(qapp, "theme"): + apply_theme("light") + qapp.processEvents() + yield # if the test failed, we don't want to check for open widgets as