From 690043109b23518c14c1b9df1e9c6e98133b5c50 Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Mon, 14 Oct 2024 18:12:36 +0200 Subject: [PATCH 1/3] Add type hint for QtBot --- src/labelle/gui/tests/test_gui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/labelle/gui/tests/test_gui.py b/src/labelle/gui/tests/test_gui.py index 3008f74a..b0c41dd2 100644 --- a/src/labelle/gui/tests/test_gui.py +++ b/src/labelle/gui/tests/test_gui.py @@ -1,10 +1,12 @@ +from pytestqt.qtbot import QtBot + from labelle.gui.gui import LabelleWindow from labelle.gui.q_label_widgets import ( TextDymoLabelWidget, ) -def test_main_window(qtbot): +def test_main_window(qtbot: QtBot): widget = LabelleWindow() qtbot.addWidget(widget) From 7380cad21336605b5106727bd47f81fbd1944807 Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Mon, 14 Oct 2024 18:34:38 +0200 Subject: [PATCH 2/3] Set the pytest-qt API explicitly to PyQT6 Closes #87 Another potential backend is pyside6, and if both are available then pytest can become confused. --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f11d546d..4f25a7f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,6 +89,9 @@ replacement = ' Date: Mon, 14 Oct 2024 18:49:20 +0200 Subject: [PATCH 3/3] Run apt-get update in GitHub workflow Otherwise apt-get install has started to fail. --- .github/workflows/tests.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c20a4469..3e7faad0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,8 +23,18 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - sudo apt-get install -y libegl1 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils libgl1 libdbus-1-3 libxcb-cursor0 - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX + sudo apt-get update && sudo apt-get install -y \ + libegl1 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 \ + libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \ + libxcb-xinerama0 libxcb-xfixes0 x11-utils libgl1 \ + libdbus-1-3 libxcb-cursor0 + /sbin/start-stop-daemon --start --quiet \ + --pidfile /tmp/custom_xvfb_99.pid \ + --make-pidfile \ + --background \ + --exec /usr/bin/Xvfb \ + -- \ + :99 -screen 0 1920x1200x24 -ac +extension GLX python -m pip install --upgrade pip pip install tox tox-gh-actions - name: Test with tox