From 0844a9e11975a34780b1dc413f5145517d1a1a22 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Mon, 21 Jul 2025 21:24:13 +0200 Subject: [PATCH] test(conftest): suppress_message_box for error popups fixture autouse True --- tests/unit_tests/conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit_tests/conftest.py b/tests/unit_tests/conftest.py index aec6e686..f0160a92 100644 --- a/tests/unit_tests/conftest.py +++ b/tests/unit_tests/conftest.py @@ -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