diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 496d18b..5db7858 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,13 +9,18 @@ on: jobs: test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Oldest supported version from the readme up to the newest one + python-version: ["3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v7 - - name: Set up Python + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v7 with: - python-version: "3.15" + python-version: ${{ matrix.python-version }} - name: Install dependencies run: pip install -r requirements-dev.txt diff --git a/test/ui_test_support.py b/test/ui_test_support.py index 80b1dd4..99f0a1c 100644 --- a/test/ui_test_support.py +++ b/test/ui_test_support.py @@ -5,7 +5,6 @@ instead of being skipped, e.g. in CI where they must always run. """ -import importlib.util import os import unittest from typing import Callable, TypeVar @@ -18,8 +17,15 @@ def has_tkinter() -> bool: """ Returns if tkinter can be imported. + The module can exist while the Tk library of the system is missing, + so it is really imported instead of only searched. """ - return importlib.util.find_spec("tkinter") is not None + try: + # pylint: disable=import-outside-toplevel,unused-import + import tkinter # noqa: F401 + except ImportError: + return False + return True def has_display() -> bool: