linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Tissoires <bentiss@kernel.org>
To: Jiri Kosina <jikos@kernel.org>,
	 Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	 Shuah Khan <shuah@kernel.org>,
	Peter Hutterer <peter.hutterer@who-t.net>
Cc: linux-input@vger.kernel.org, linux-kselftest@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	Benjamin Tissoires <bentiss@kernel.org>
Subject: [PATCH v2 14/15] selftests/hid: fix mypy complains
Date: Wed, 06 Dec 2023 11:46:05 +0100	[thread overview]
Message-ID: <20231206-wip-selftests-v2-14-c0350c2f5986@kernel.org> (raw)
In-Reply-To: <20231206-wip-selftests-v2-0-c0350c2f5986@kernel.org>

No code change, only typing information added/ignored

Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>

---

new in v2
---
 tools/testing/selftests/hid/tests/base.py        |  4 ++--
 tools/testing/selftests/hid/tests/test_tablet.py | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/testing/selftests/hid/tests/base.py b/tools/testing/selftests/hid/tests/base.py
index 5d9c26dfc460..51433063b227 100644
--- a/tools/testing/selftests/hid/tests/base.py
+++ b/tools/testing/selftests/hid/tests/base.py
@@ -14,7 +14,7 @@ import logging
 
 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")
 
@@ -155,7 +155,7 @@ class BaseTestCase:
         # 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()
diff --git a/tools/testing/selftests/hid/tests/test_tablet.py b/tools/testing/selftests/hid/tests/test_tablet.py
index 9374bd7524ef..dc8b0fe9e7f3 100644
--- a/tools/testing/selftests/hid/tests/test_tablet.py
+++ b/tools/testing/selftests/hid/tests/test_tablet.py
@@ -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":
@@ -122,7 +122,7 @@ class PenState(Enum):
         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:
@@ -162,7 +162,7 @@ class PenState(Enum):
         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()

-- 
2.41.0


  parent reply	other threads:[~2023-12-06 10:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 10:45 [PATCH v2 00/15] selftests/hid: tablets fixes Benjamin Tissoires
2023-12-06 10:45 ` [PATCH v2 01/15] selftests/hid: vmtest.sh: update vm2c and container Benjamin Tissoires
2023-12-06 10:45 ` [PATCH v2 02/15] selftests/hid: vmtest.sh: allow finer control on the build steps Benjamin Tissoires
2023-12-06 10:45 ` [PATCH v2 03/15] selftests/hid: base: allow for multiple skip_if_uhdev Benjamin Tissoires
2023-12-06 10:45 ` [PATCH v2 04/15] selftests/hid: tablets: remove unused class Benjamin Tissoires
2023-12-06 10:45 ` [PATCH v2 05/15] selftests/hid: tablets: move the transitions to PenState Benjamin Tissoires
2023-12-06 10:45 ` [PATCH v2 06/15] selftests/hid: tablets: move move_to function to PenDigitizer Benjamin Tissoires
2023-12-06 10:45 ` [PATCH v2 07/15] selftests/hid: tablets: do not set invert when the eraser is used Benjamin Tissoires
2023-12-06 10:45 ` [PATCH v2 08/15] selftests/hid: tablets: set initial data for tilt/twist Benjamin Tissoires
2023-12-06 10:46 ` [PATCH v2 09/15] selftests/hid: tablets: define the elements of PenState Benjamin Tissoires
2023-12-06 10:46 ` [PATCH v2 10/15] selftests/hid: tablets: add variants of states with buttons Benjamin Tissoires
2023-12-06 10:46 ` [PATCH v2 11/15] selftests/hid: tablets: convert the primary button tests Benjamin Tissoires
2023-12-06 10:46 ` [PATCH v2 12/15] selftests/hid: tablets: add a secondary barrel switch test Benjamin Tissoires
2023-12-06 10:46 ` [PATCH v2 13/15] selftests/hid: tablets: be stricter for some transitions Benjamin Tissoires
2023-12-06 10:46 ` Benjamin Tissoires [this message]
2023-12-06 10:46 ` [PATCH v2 15/15] selftests/hid: fix ruff linter complains Benjamin Tissoires
2023-12-06 23:32 ` [PATCH v2 00/15] selftests/hid: tablets fixes Jiri Kosina
2023-12-07  8:53 ` Benjamin Tissoires
2023-12-07  8:56   ` Benjamin Tissoires

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231206-wip-selftests-v2-14-c0350c2f5986@kernel.org \
    --to=bentiss@kernel.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=peter.hutterer@who-t.net \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).