Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/hid: fix mypy complains

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>

+7 -7
+2 -2
tools/testing/selftests/hid/tests/base.py
··· 14 14 15 15 from hidtools.device.base_device import BaseDevice, EvdevMatch, SysfsFile 16 16 from pathlib import Path 17 - from typing import Final 17 + from typing import Final, List, Tuple 18 18 19 19 logger = logging.getLogger("hidtools.test.base") 20 20 ··· 155 155 # if any module is not available (not compiled), the test will skip. 156 156 # Each element is a tuple '(kernel driver name, kernel module)', 157 157 # for example ("playstation", "hid-playstation") 158 - kernel_modules = [] 158 + kernel_modules: List[Tuple[str, str]] = [] 159 159 160 160 def assertInputEventsIn(self, expected_events, effective_events): 161 161 effective_events = effective_events.copy()
+5 -5
tools/testing/selftests/hid/tests/test_tablet.py
··· 87 87 ) 88 88 89 89 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 93 93 94 94 @classmethod 95 95 def from_evdev(cls, evdev) -> "PenState": ··· 122 122 if tool is None: 123 123 button = None 124 124 125 - return cls((touch, tool, button)) 125 + return cls((touch, tool, button)) # type: ignore 126 126 127 127 def apply(self, events: List[libevdev.InputEvent], strict: bool) -> "PenState": 128 128 if libevdev.EV_SYN.SYN_REPORT in events: ··· 162 162 if tool is None: 163 163 button = None 164 164 165 - new_state = PenState((touch, tool, button)) 165 + new_state = PenState((touch, tool, button)) # type: ignore 166 166 if strict: 167 167 assert ( 168 168 new_state in self.valid_transitions()