Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp885128rdb; Wed, 6 Dec 2023 02:48:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVIMJWAfBCDwF2Kq7McZzkDkm65PGAvL0Z23uOgmx6U6CAu2O8TGE55L1rQszD416cWxHI X-Received: by 2002:a05:6a21:998c:b0:18f:97c:925e with SMTP id ve12-20020a056a21998c00b0018f097c925emr549014pzb.67.1701859687137; Wed, 06 Dec 2023 02:48:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701859687; cv=none; d=google.com; s=arc-20160816; b=VZdK9kUExmxXfrriILQ7hZDL8cJO3joLSYCFvm8Yay3E/vDKAE/6UC8zlYofJEJhA5 dIXeMlUwUlqi010WR++AlQJdr9WdkGv3sFMyjlQRJVV5/DUas9QHU3QVoB5523RYTHDO K16uJ5k7nFjvzwqlPsOCNka2GsnQj8NY2auD8VV6AFI9DDe3SDDpL3K2g+kK2I1rL3Pa gEJnz5avbbP8t+xFmG+b7iRYgCHAdC/SWNz6vOXL4TjxlQDvNtGxfW/WB2QI8Z1zRJGv gCBS5mAcA/NBehx/gSgX3uzLvltM3KKVJKjNfP3NYCwvgaCJczshQSnWuV5sapjEOBBV nQcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=FkDjiNZkjpsxzDljuREwNaUkl0sf8HCXHaGek6o0wHA=; fh=M/4CRKlsQR53kOvbvsHfGDOrpcvBUt/h3Rh4tB3zkdA=; b=hzcPQvchcEBhLmErrCCqoGi/n8eTREYuJONqZJvs762mmBmt0EQM7W/m2Xsq2/Ziuw zS8UK7V74mSTlxrK2DSObJTFCfHq0Gb6c1b4zeZ1nGbEx3w0W6i4OfF/TLFzjrcAyT8n FF3heKDm/L2XauSmEScYUyA+EulAperE9/PSrH+SIxosqB4tlQyyz7Jg0diR3dhobAG2 WJ+8MczD2RLWYCchmoqrM4c8ZwBzPEg0bIPItmM8MZuN8YwluLh7lNvAfAPdwtIYDaKg Q3Ya7hw3MffwX5Kqe7dzoPAlhvu1skt2r+HHVcW3Z//C1MwHQbQF8grBnUxHOb59dHoi R8Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O9I5lN34; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id cv4-20020a17090afd0400b0028647ec59c3si10677935pjb.85.2023.12.06.02.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 02:48:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O9I5lN34; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 232E980321E7; Wed, 6 Dec 2023 02:48:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377836AbjLFKr3 (ORCPT + 99 others); Wed, 6 Dec 2023 05:47:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377705AbjLFKq5 (ORCPT ); Wed, 6 Dec 2023 05:46:57 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD21D1BD4 for ; Wed, 6 Dec 2023 02:46:35 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F21B6C433AB; Wed, 6 Dec 2023 10:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701859595; bh=qlUB59mdEXNSA6/Zy2rtughuPHzMiJYZi2ulYjUvu2c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=O9I5lN34VEbMkUNQPkDh2gcPlZCb/4oo4HxVfVBsJZDFEdGfsBIu1Dl0KV7TsOc1+ thVHfa5iaAsFXqjzpltYqH2cJaMTfEC+1Oz9PilY/L21mxoQsQwhQbFB+ZQmztkvI7 3qzKTxDVtFsPke6jhxiPNgUhnjGq07Np+HCWNVxU2Xn2BEMfIiZS79lzgpYw8kNqaQ 0Amuw944V/ZwodOsYbIUwnQYLz2DBRTICETb7adtS5shOAsdKzBlvqJqLDIFvHxnNf qxKG/4demQ7u1IOapRbP2FO/p+yaxqquDnvFxr1gcJIOg2KOGLKUmqdbhkxEht8mc3 Xc2ck5F0nBJuw== From: Benjamin Tissoires Date: Wed, 06 Dec 2023 11:46:05 +0100 Subject: [PATCH v2 14/15] selftests/hid: fix mypy complains MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231206-wip-selftests-v2-14-c0350c2f5986@kernel.org> References: <20231206-wip-selftests-v2-0-c0350c2f5986@kernel.org> In-Reply-To: <20231206-wip-selftests-v2-0-c0350c2f5986@kernel.org> To: Jiri Kosina , Benjamin Tissoires , Shuah Khan , Peter Hutterer Cc: linux-input@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1701859565; l=2690; i=bentiss@kernel.org; s=20230215; h=from:subject:message-id; bh=qlUB59mdEXNSA6/Zy2rtughuPHzMiJYZi2ulYjUvu2c=; b=eNuto/PCVNKt4hEZ3qf3mbOg5IFQ64ju2cLEbB7qwWDnWb+JsGHfxC2TZ818Uigmv40m14QLs gmWRqXz+HseB49TOWMNIE0QwU8o9CxUQHoTHdea4CjX4JMMC85zKw1+ X-Developer-Key: i=bentiss@kernel.org; a=ed25519; pk=7D1DyAVh6ajCkuUTudt/chMuXWIJHlv2qCsRkIizvFw= X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 06 Dec 2023 02:48:04 -0800 (PST) No code change, only typing information added/ignored Signed-off-by: Benjamin Tissoires --- 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