Commit ed5bc56c authored by Benjamin Tissoires's avatar Benjamin Tissoires

selftests/hid: fix mypy complains

No code change, only typing information added/ignored
Acked-by: default avatarJiri Kosina <jkosina@suse.com>
Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-14-c0350c2f5986@kernel.orgSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
parent ab9b8290
...@@ -14,7 +14,7 @@ import logging ...@@ -14,7 +14,7 @@ import logging
from hidtools.device.base_device import BaseDevice, EvdevMatch, SysfsFile from hidtools.device.base_device import BaseDevice, EvdevMatch, SysfsFile
from pathlib import Path from pathlib import Path
from typing import Final from typing import Final, List, Tuple
logger = logging.getLogger("hidtools.test.base") logger = logging.getLogger("hidtools.test.base")
...@@ -155,7 +155,7 @@ class BaseTestCase: ...@@ -155,7 +155,7 @@ class BaseTestCase:
# if any module is not available (not compiled), the test will skip. # if any module is not available (not compiled), the test will skip.
# Each element is a tuple '(kernel driver name, kernel module)', # Each element is a tuple '(kernel driver name, kernel module)',
# for example ("playstation", "hid-playstation") # for example ("playstation", "hid-playstation")
kernel_modules = [] kernel_modules: List[Tuple[str, str]] = []
def assertInputEventsIn(self, expected_events, effective_events): def assertInputEventsIn(self, expected_events, effective_events):
effective_events = effective_events.copy() effective_events = effective_events.copy()
......
...@@ -87,9 +87,9 @@ class PenState(Enum): ...@@ -87,9 +87,9 @@ class PenState(Enum):
) )
def __init__(self, touch: BtnTouch, tool: Optional[ToolType], button: Optional[BtnPressed]): def __init__(self, touch: BtnTouch, tool: Optional[ToolType], button: Optional[BtnPressed]):
self.touch = touch self.touch = touch # type: ignore
self.tool = tool self.tool = tool # type: ignore
self.button = button self.button = button # type: ignore
@classmethod @classmethod
def from_evdev(cls, evdev) -> "PenState": def from_evdev(cls, evdev) -> "PenState":
...@@ -122,7 +122,7 @@ class PenState(Enum): ...@@ -122,7 +122,7 @@ class PenState(Enum):
if tool is None: if tool is None:
button = None button = None
return cls((touch, tool, button)) return cls((touch, tool, button)) # type: ignore
def apply(self, events: List[libevdev.InputEvent], strict: bool) -> "PenState": def apply(self, events: List[libevdev.InputEvent], strict: bool) -> "PenState":
if libevdev.EV_SYN.SYN_REPORT in events: if libevdev.EV_SYN.SYN_REPORT in events:
...@@ -162,7 +162,7 @@ class PenState(Enum): ...@@ -162,7 +162,7 @@ class PenState(Enum):
if tool is None: if tool is None:
button = None button = None
new_state = PenState((touch, tool, button)) new_state = PenState((touch, tool, button)) # type: ignore
if strict: if strict:
assert ( assert (
new_state in self.valid_transitions() new_state in self.valid_transitions()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment