Skip to content

Commit

Permalink
selftests/hid: fix mypy complains
Browse files Browse the repository at this point in the history
No code change, only typing information added/ignored

Acked-by: Jiri Kosina <jkosina@suse.com>
Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-14-c0350c2f5986@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
  • Loading branch information
Benjamin Tissoires committed Dec 7, 2023
1 parent ab9b829 commit ed5bc56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/hid/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from hidtools.device.base_device import BaseDevice, EvdevMatch, SysfsFile
from pathlib import Path
from typing import Final
from typing import Final, List, Tuple

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

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

def assertInputEventsIn(self, expected_events, effective_events):
effective_events = effective_events.copy()
Expand Down
10 changes: 5 additions & 5 deletions tools/testing/selftests/hid/tests/test_tablet.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ class PenState(Enum):
)

def __init__(self, touch: BtnTouch, tool: Optional[ToolType], button: Optional[BtnPressed]):
self.touch = touch
self.tool = tool
self.button = button
self.touch = touch # type: ignore
self.tool = tool # type: ignore
self.button = button # type: ignore

@classmethod
def from_evdev(cls, evdev) -> "PenState":
Expand Down Expand Up @@ -122,7 +122,7 @@ def from_evdev(cls, evdev) -> "PenState":
if tool is 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":
if libevdev.EV_SYN.SYN_REPORT in events:
Expand Down Expand Up @@ -162,7 +162,7 @@ def apply(self, events: List[libevdev.InputEvent], strict: bool) -> "PenState":
if tool is None:
button = None

new_state = PenState((touch, tool, button))
new_state = PenState((touch, tool, button)) # type: ignore
if strict:
assert (
new_state in self.valid_transitions()
Expand Down

0 comments on commit ed5bc56

Please sign in to comment.