diff --git a/betty/tests/gui/test_project.py b/betty/tests/gui/test_project.py index f0f0c8a52..8e8325b7e 100644 --- a/betty/tests/gui/test_project.py +++ b/betty/tests/gui/test_project.py @@ -3,7 +3,6 @@ from pathlib import Path import aiofiles -from PyQt6.QtCore import Qt from PyQt6.QtWidgets import QFileDialog from pytest_mock import MockerFixture from pytestqt.qtbot import QtBot @@ -225,11 +224,9 @@ async def test_serve_button_should_open_serve_window( sut = _GenerateWindow(app) betty_qtbot.qtbot.addWidget(sut) - with betty_qtbot.qtbot.waitSignal(sut._thread.finished): - sut.show() - betty_qtbot.qtbot.mouseClick(sut._cancel_button, Qt.MouseButton.LeftButton) - - betty_qtbot.qtbot.mouseClick(sut._serve_button, Qt.MouseButton.LeftButton) + sut.show() + betty_qtbot.qtbot.waitSignal(sut._thread.finished).wait() + betty_qtbot.mouse_click(sut._serve_button) betty_qtbot.assert_window(ServeProjectWindow)