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