From 00be6dda22ca4b890832803e8338c1d5600c7d99 Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Wed, 21 Feb 2024 19:07:09 +0000 Subject: [PATCH] Fix broken test coverage for serving a site directly after generating it through the Graphical User Interface --- betty/tests/gui/test_project.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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)