Es scheint, dass das Problem damit zusammenhängt Die Qt-Schnittstelle „friert“ ein, wenn ein Haltepunkt erreicht wird, und sie „taut nicht auf“, sodass die Tests nicht fortgesetzt werden können.
Hier ist ein Ausschnitt des problematischen Codes:
Code: Select all
def click_next_from_creation_plg(ctrl: Controller, qt_bot: QtBot, expected_res: bool):
"""
Click on next button from plugin creation panel and check if it's active
:param ctrl: Application controller
:param qt_bot: (QtBot) qt test fixture instance
:param expected_res: expected result on click, true if the button work, false else it doesn't work
:return: None
"""
current_page = ctrl.gui.stackedWidget.currentIndex()
if ctrl.main_window is not None and ctrl.main_window.isVisible():
if expected_res:
QTest.mouseClick(ctrl.create_panel.gui.button_next, Qt.MouseButton.LeftButton)
qt_bot.waitUntil(lambda: ctrl.gui.stackedWidget.currentIndex() != current_page, timeout=WAITING_QTBOT)
assert current_page != ctrl.gui.stackedWidget.currentIndex(), ("The current page should change when "
"the next button is clicked.")
else:
with qt_bot.assertNotEmitted(ctrl.create_panel.nextClicked):
QTest.mouseClick(ctrl.create_panel.gui.button_next, Qt.MouseButton.LeftButton)
assert current_page == ctrl.gui.stackedWidget.currentIndex(), ("The current page should not change "
"when the next button is clicked but "
"is not functional.")
assert ctrl.gui.button_next.isEnabled() is expected_res, ("The next button's enabled state does not match the "
"expected result.")
Code: Select all
def click_next_from_creation_plg(ctrl: Controller, qt_bot: QtBot, expected_res: bool):
"""
Click on next button from plugin creation panel and check if it's active
:param ctrl: Application controller
:param qt_bot: (QtBot) qt test fixture instance
:param expected_res: expected result on click, true if the button work, false else it doesn't work
:return: None
"""
current_page = ctrl.gui.stackedWidget.currentIndex()
if ctrl.main_window is not None and ctrl.main_window.isVisible():
if expected_res:
QTest.mouseClick(ctrl.create_panel.gui.button_next, Qt.MouseButton.LeftButton)
> qt_bot.waitUntil(lambda: ctrl.gui.stackedWidget.currentIndex() != current_page, timeout=WAITING_QTBOT)
E pytestqt.exceptions.TimeoutError: waitUntil timed out in 5000 milliseconds
tools.py:164: TimeoutError