From 79620ebc19cae310c7639e76390dbd96a9538295 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 1 Oct 2020 22:22:58 +0200 Subject: [PATCH] Attempt to fix the wizard test --- tests/test_dialogs.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/test_dialogs.py b/tests/test_dialogs.py index 9fa4c531..5afbaa4b 100644 --- a/tests/test_dialogs.py +++ b/tests/test_dialogs.py @@ -752,21 +752,11 @@ def testNewProjectWizard(qtbot, monkeypatch, yesToAll, nwMinimal, nwTemp): assert not nwGUI.newProject() monkeypatch.undo() - nwGUI.closeMain() - nwGUI.close() - - # qtbot.stopForInteraction() ## # Test the Wizard ## - nwGUI = nw.main(["--testmode", "--config=%s" % nwMinimal, "--data=%s" % nwTemp]) - qtbot.addWidget(nwGUI) - nwGUI.show() - qtbot.waitForWindowShown(nwGUI) - qtbot.wait(stepDelay) - monkeypatch.setattr(GuiProjectWizard, "exec_", lambda *args: None) nwGUI.mainConf.lastPath = " " @@ -782,7 +772,8 @@ def testNewProjectWizard(qtbot, monkeypatch, yesToAll, nwMinimal, nwTemp): nwWiz = getGuiItem("GuiProjectWizard") assert isinstance(nwWiz, GuiProjectWizard) nwWiz.show() - qtbot.waitForWindowShown(nwWiz) + nwWiz.setObjectName("Dummy%d" % wStep) # Hack to prevent returning the same object twice + qtbot.wait(stepDelay) # Intro Page introPage = nwWiz.currentPage() @@ -911,7 +902,6 @@ def testNewProjectWizard(qtbot, monkeypatch, yesToAll, nwMinimal, nwTemp): nwWiz.reject() nwWiz.close() - del nwWiz # qtbot.stopForInteraction() nwGUI.closeMain()