From ac79abffeb86a5ff4f5907ba915c133702f3c29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Ri=C3=9Fe?= Date: Mon, 18 Mar 2024 16:27:55 +0100 Subject: [PATCH] Fix a potential race condition --- tests/_test_msui/test_mscolab.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/_test_msui/test_mscolab.py b/tests/_test_msui/test_mscolab.py index 4504f6a70..acf80dc92 100644 --- a/tests/_test_msui/test_mscolab.py +++ b/tests/_test_msui/test_mscolab.py @@ -408,7 +408,10 @@ def test_browse_add_operation(self, mockopen, qtbot): self.window.mscolab.add_proj_dialog.buttonBox.Ok) with mock.patch("PyQt5.QtWidgets.QMessageBox.information") as m: QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton) - m.assert_called_once() + + def assert_(): + m.assert_called_once() + qtbot.wait_until(assert_) def assert_(): assert self.window.listOperationsMSC.model().rowCount() == 1