Skip to content

Commit ed5bc56

Browse files
author
Benjamin Tissoires
committed
selftests/hid: fix mypy complains
No code change, only typing information added/ignored Acked-by: Jiri Kosina <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent ab9b829 commit ed5bc56

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 2 additions & 2 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()

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ class PenState(Enum):
8787
)
8888

8989
def __init__(self, touch: BtnTouch, tool: Optional[ToolType], button: Optional[BtnPressed]):
90-
self.touch = touch
91-
self.tool = tool
92-
self.button = button
90+
self.touch = touch # type: ignore
91+
self.tool = tool # type: ignore
92+
self.button = button # type: ignore
9393

9494
@classmethod
9595
def from_evdev(cls, evdev) -> "PenState":
@@ -122,7 +122,7 @@ def from_evdev(cls, evdev) -> "PenState":
122122
if tool is None:
123123
button = None
124124

125-
return cls((touch, tool, button))
125+
return cls((touch, tool, button)) # type: ignore
126126

127127
def apply(self, events: List[libevdev.InputEvent], strict: bool) -> "PenState":
128128
if libevdev.EV_SYN.SYN_REPORT in events:
@@ -162,7 +162,7 @@ def apply(self, events: List[libevdev.InputEvent], strict: bool) -> "PenState":
162162
if tool is None:
163163
button = None
164164

165-
new_state = PenState((touch, tool, button))
165+
new_state = PenState((touch, tool, button)) # type: ignore
166166
if strict:
167167
assert (
168168
new_state in self.valid_transitions()

0 commit comments

Comments
 (0)