0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-13 19:21:50 +02:00

fix: reset ErrorPopup singleton between tests

This commit is contained in:
2024-07-25 19:04:21 +02:00
parent fc57b7a126
commit 5a9ccfd1f6
2 changed files with 6 additions and 2 deletions

View File

@ -71,8 +71,6 @@ class _ErrorPopupUtility(QObject):
error_occurred = Signal(str, str, QWidget)
def __init__(self, parent=None):
super().__init__(parent=parent)
self.error_occurred.connect(self.show_error_message)

View File

@ -1,6 +1,7 @@
import pytest
from bec_widgets.cli.rpc_register import RPCRegister
from bec_widgets.qt_utils import error_popups
from bec_widgets.utils import bec_dispatcher as bec_dispatcher_module
@ -19,3 +20,8 @@ def bec_dispatcher(threads_check):
bec_dispatcher.client.shutdown()
# reinitialize singleton for next test
bec_dispatcher_module.BECDispatcher.reset_singleton()
@pytest.fixture(autouse=True)
def clean_singleton():
error_popups._popup_utility_instance = None