Skip to content

Commit 1cb09b5

Browse files
author
Jiri Kosina
committed
Merge branch 'for-6.8/selftests' into for-linus
- greatly improved coverage of Tablets in hid-selftests (Benjamin Tissoires)
2 parents f54a651 + da2c1b8 commit 1cb09b5

File tree

5 files changed

+567
-270
lines changed

5 files changed

+567
-270
lines changed

tools/testing/selftests/hid/tests/base.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from hidtools.device.base_device import BaseDevice, EvdevMatch, SysfsFile
1616
from pathlib import Path
17-
from typing import Final
17+
from typing import Final, List, Tuple
1818

1919
logger = logging.getLogger("hidtools.test.base")
2020

@@ -155,7 +155,7 @@ class TestUhid(object):
155155
# if any module is not available (not compiled), the test will skip.
156156
# Each element is a tuple '(kernel driver name, kernel module)',
157157
# for example ("playstation", "hid-playstation")
158-
kernel_modules = []
158+
kernel_modules: List[Tuple[str, str]] = []
159159

160160
def assertInputEventsIn(self, expected_events, effective_events):
161161
effective_events = effective_events.copy()
@@ -238,8 +238,7 @@ def context(self, new_uhdev, request):
238238
try:
239239
with HIDTestUdevRule.instance():
240240
with new_uhdev as self.uhdev:
241-
skip_cond = request.node.get_closest_marker("skip_if_uhdev")
242-
if skip_cond:
241+
for skip_cond in request.node.iter_markers("skip_if_uhdev"):
243242
test, message, *rest = skip_cond.args
244243

245244
if test(self.uhdev):

tools/testing/selftests/hid/tests/test_mouse.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ def create_report(self, x, y, buttons=None, wheels=None, reportID=None):
5252
:param reportID: the numeric report ID for this report, if needed
5353
"""
5454
if buttons is not None:
55-
l, r, m = buttons
56-
if l is not None:
57-
self.left = l
58-
if r is not None:
59-
self.right = r
60-
if m is not None:
61-
self.middle = m
55+
left, right, middle = buttons
56+
if left is not None:
57+
self.left = left
58+
if right is not None:
59+
self.right = right
60+
if middle is not None:
61+
self.middle = middle
6262
left = self.left
6363
right = self.right
6464
middle = self.middle

0 commit comments

Comments
 (0)