1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-10 02:37:59 +01:00

test(conftest): suppress_message_box for error popups fixture autouse True

This commit is contained in:
2025-07-21 21:24:13 +02:00
committed by Jan Wyzula
parent db7dd4f8d4
commit 0844a9e119

View File

@@ -69,6 +69,14 @@ def clean_singleton():
error_popups._popup_utility_instance = None
@pytest.fixture(autouse=True)
def suppress_message_box(monkeypatch):
"""
Auto-suppress any QMessageBox.exec_ calls by returning Ok immediately.
"""
monkeypatch.setattr(QMessageBox, "exec_", lambda *args, **kwargs: QMessageBox.Ok)
def create_widget(qtbot, widget, *args, **kwargs):
"""
Create a widget and add it to the qtbot for testing. This is a helper function that