From ddda934eedd1ce4c942ac0576692a25700bd46f7 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 31 Jan 2021 12:56:58 +0100 Subject: [PATCH] Fix tests --- tests/test_gui/test_gui_doceditor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_gui/test_gui_doceditor.py b/tests/test_gui/test_gui_doceditor.py index cb9f35d1..b169e457 100644 --- a/tests/test_gui/test_gui_doceditor.py +++ b/tests/test_gui/test_gui_doceditor.py @@ -28,8 +28,9 @@ from tools import cmpFiles from PyQt5.QtCore import Qt from PyQt5.QtGui import QTextCursor -from PyQt5.QtWidgets import QAction, QMessageBox +from PyQt5.QtWidgets import QAction, QMessageBox, QDialog +from nw.gui.itemeditor import GuiItemEditor from nw.gui.doceditor import GuiDocEditor from nw.gui.projtree import GuiProjectTree from nw.constants import nwItemType, nwDocAction @@ -44,6 +45,9 @@ def testGuiEditor_Main(qtbot, monkeypatch, nwGUI, fncDir, fncProj, refDir, outDi """ # Block message box monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes) + monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes) + monkeypatch.setattr(GuiItemEditor, "exec_", lambda *args: None) + monkeypatch.setattr(GuiItemEditor, "result", lambda *args: QDialog.Accepted) monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True) monkeypatch.setattr(GuiDocEditor, "hasFocus", lambda *args: True)