diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2025-12-22 02:43:35 +0300 |
|---|---|---|
| committer | Benjamin Tissoires <bentiss@kernel.org> | 2026-01-07 17:28:09 +0300 |
| commit | 1d6628f7f279131ac9efb743bcea7080666d7574 (patch) | |
| tree | 10cd385ffbdd6c287dcea155338e720f109bb9dd /tools | |
| parent | 2b29a90131bbb3d404e5bf5102af5ce98ccf96fe (diff) | |
| download | linux-1d6628f7f279131ac9efb743bcea7080666d7574.tar.xz | |
selftests/hid: require hidtools 0.12
Not all our tests really require it but since it's likely pip-installed
anyway it's trivial to require the new version, just in case we want to
start cleaning up other bits.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/testing/selftests/hid/tests/conftest.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/testing/selftests/hid/tests/conftest.py b/tools/testing/selftests/hid/tests/conftest.py index 1361ec981db6..985a535324b2 100644 --- a/tools/testing/selftests/hid/tests/conftest.py +++ b/tools/testing/selftests/hid/tests/conftest.py @@ -5,6 +5,7 @@ # Copyright (c) 2017 Benjamin Tissoires <benjamin.tissoires@gmail.com> # Copyright (c) 2017 Red Hat, Inc. +from packaging.version import Version import platform import pytest import re @@ -14,6 +15,19 @@ from .base import HIDTestUdevRule from pathlib import Path +@pytest.fixture(autouse=True) +def hidtools_version_check(): + HIDTOOLS_VERSION = "0.12" + try: + import hidtools + + version = hidtools.__version__ # type: ignore + if Version(version) < Version(HIDTOOLS_VERSION): + pytest.skip(reason=f"have hidtools {version}, require >={HIDTOOLS_VERSION}") + except Exception: + pytest.skip(reason=f"hidtools >={HIDTOOLS_VERSION} required") + + # See the comment in HIDTestUdevRule, this doesn't set up but it will clean # up once the last test exited. @pytest.fixture(autouse=True, scope="session") |
