Fix tests

This commit is contained in:
Veronica K. B. Olsen
2021-01-31 11:58:56 +01:00
parent f73cdac9e2
commit b02c4904a9
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -12,6 +12,7 @@ from PyQt5.QtCore import Qt
from PyQt5.QtGui import QTextCursor
from PyQt5.QtWidgets import QAction, QMessageBox
from nw.gui.projtree import GuiProjectTree
from nw.constants import nwItemType, nwDocAction
keyDelay = 2
@@ -24,6 +25,7 @@ def testGuiEditor_Main(qtbot, monkeypatch, nwGUI, fncDir, fncProj, refDir, outDi
"""
# Block message box
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True)
# Create new, save, close project
nwGUI.theProject.projTree.setSeed(42)
+4 -1
View File
@@ -10,6 +10,8 @@ from tools import writeFile
from PyQt5.QtCore import QItemSelectionModel
from PyQt5.QtWidgets import QAction, QMessageBox
from nw.guimain import GuiMain
from nw.gui.projtree import GuiProjectTree
from nw.constants import nwItemType, nwItemClass
@pytest.mark.gui
@@ -18,7 +20,8 @@ def testGuiProjTree_TreeItems(qtbot, caplog, monkeypatch, nwGUI, nwMinimal):
"""
# Block message box
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
monkeypatch.setattr("nw.guimain.GuiMain.editItem", lambda *args: None)
monkeypatch.setattr(GuiMain, "editItem", lambda *args: None)
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True)
nwGUI.theProject.projTree.setSeed(42)
nwTree = nwGUI.treeView