Replace exec_ with exec
This commit is contained in:
@@ -60,7 +60,7 @@ def testToolLipsum_Main(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
||||
assert nwGUI.openDocument(C.hSceneDoc) is True
|
||||
nwGUI.docEditor.setCursorLine(3)
|
||||
with monkeypatch.context() as mp:
|
||||
mp.setattr(GuiLipsum, "exec_", lambda *a: None)
|
||||
mp.setattr(GuiLipsum, "exec", lambda *a: None)
|
||||
mp.setattr(GuiLipsum, "lipsumText", "FooBar")
|
||||
nwGUI.mainMenu.aLipsumText.activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText() == "### New Scene\n\nFooBar"
|
||||
|
||||
@@ -278,7 +278,7 @@ def testManuscript_Features(monkeypatch, qtbot, nwGUI, projPath, mockRnd):
|
||||
build._changed = True
|
||||
manus.buildList.clearSelection()
|
||||
with monkeypatch.context() as mp:
|
||||
mp.setattr("novelwriter.tools.manusbuild.GuiManuscriptBuild.exec_", lambda *a: None)
|
||||
mp.setattr("novelwriter.tools.manusbuild.GuiManuscriptBuild.exec", lambda *a: None)
|
||||
|
||||
manus.buildList.setCurrentRow(0)
|
||||
manus.btnBuild.click()
|
||||
@@ -313,7 +313,7 @@ def testManuscript_Print(monkeypatch, qtbot: QtBot, nwGUI: GuiMain, projPath: Pa
|
||||
assert manus.docPreview.toPlainText().strip() != ""
|
||||
|
||||
with monkeypatch.context() as mp:
|
||||
mp.setattr(QPrintPreviewDialog, "exec_", lambda *a: None)
|
||||
mp.setattr(QPrintPreviewDialog, "exec", lambda *a: None)
|
||||
manus.btnPrint.click()
|
||||
for obj in manus.children():
|
||||
if isinstance(obj, QPrintPreviewDialog):
|
||||
|
||||
@@ -70,7 +70,7 @@ def testToolWelcome_Main(qtbot: QtBot, monkeypatch, nwGUI, fncPath):
|
||||
@pytest.mark.gui
|
||||
def testToolWelcome_Open(qtbot: QtBot, monkeypatch, nwGUI, fncPath):
|
||||
"""Test the open tab in the Welcome window."""
|
||||
monkeypatch.setattr(QMenu, "exec_", lambda *a: None)
|
||||
monkeypatch.setattr(QMenu, "exec", lambda *a: None)
|
||||
monkeypatch.setattr(QMenu, "deleteLater", lambda *a: None)
|
||||
|
||||
CONFIG.recentProjects.update("/stuff/project_one", "Project One", 12345, 1690000000)
|
||||
|
||||
Reference in New Issue
Block a user