From patchwork Thu Mar 16 17:28:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Latypov X-Patchwork-Id: 70924 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp612747wrt; Thu, 16 Mar 2023 10:39:24 -0700 (PDT) X-Google-Smtp-Source: AK7set8X2U579aZ+7NUDdXVG/ol3h3JNXsKrRY1zi5orQ6aX9Qw+MrF5A1iMlrDgdJpmj9cBVGyd X-Received: by 2002:a17:90b:1e43:b0:23e:fa90:ba37 with SMTP id pi3-20020a17090b1e4300b0023efa90ba37mr4578822pjb.49.1678988364518; Thu, 16 Mar 2023 10:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678988364; cv=none; d=google.com; s=arc-20160816; b=ZFFOlIDxv5rLzTkMspLGC2bOp09xWrc5mclx6vqbQXPrmsRT+dhNdvF++Dr/Hez9mb WhboEWhDhr5x869qo2JZSXjdqH1I5wlzlo2dvs9aEv12BzBIXbWk/WMVfZYsQYcoXc/v fnfPmbDrScUapiW4pyIpShdrh2y55RVRhqwAdG7Meo9ulcHJ5Kyo8OPeCKqVber+NjGB zy3njnM+qbIqLLx7WrxgNI2axZor1NJUA3c9IeLdo8jXF//Yq4GpkXgsumkR79QknoI7 2oR/KSqmrUxOK5P0m0sqc97v99t/WDyDi02q+XMJnZHDKcq/uMpeVeuO9bnFLPbi2xVg o3oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=Uq7nE/DzfEkIETd0TF3h83fIBuNZuqidPfixIYK7CAQ=; b=VxEGtnx934cHFAvXT9PHmTafy2Rs4MyTcWV7DiiFiHrBjT2XHBbLkcYhoGCPVNwhk5 Rnr6XxgPlKqvx8Ze938Bliu3pNmqg1VpLQeplozSrgTKW120bbg0TeFZU73TBlLNHygz V0oSWjs3r5xkdKCEYhANiY+8kf2wrgcKMEeFS/So+J073U5kPL2dWQNrbnc8RvOnfnk+ 0yjO5GG0EUvqY0tF8tZ1SUjY2FGV2Vh6zKKGP4FhKn1t76SE0WrV/vik9YeYtvN/15kU SgKUMTFK+dif9kjmvYo+JpEJwk+1NelEYXitW3x1R8HzqBxMYwAe1HWi2hDVc4F4LZ3H J0iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=czBNpX06; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020a17090276c200b001a05d8436d8si8478692plt.475.2023.03.16.10.38.42; Thu, 16 Mar 2023 10:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=czBNpX06; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229936AbjCPR3m (ORCPT + 99 others); Thu, 16 Mar 2023 13:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbjCPR3c (ORCPT ); Thu, 16 Mar 2023 13:29:32 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADEA7231EE for ; Thu, 16 Mar 2023 10:29:15 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id j125-20020a25d283000000b008f257b16d71so2529773ybg.15 for ; Thu, 16 Mar 2023 10:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1678987754; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=Uq7nE/DzfEkIETd0TF3h83fIBuNZuqidPfixIYK7CAQ=; b=czBNpX06izp1eLfvOstpmYwsBSgbtD3M+wd9P3LoNRWtG9xn8E0dAswbfRLY36v+x4 7W0h4LdvAhJtzF4vVnjUWoQupVUqjP+Atu7xuHS3hLIczVKyfbrjzaGFmVkTw6pe/iIK Z0YsUig0v3lTXCDyw8J0CrMsVVW0P0SBWMVaNzAV30VI3HcDcyJ4wRMX9qdDkvMVvL5l IG8vfZJTuuORFgge4J1HK1ry3F4ttiG97z9asETUt93Fg5+hWJlxGoJFrEccR6nt25On n7JEpL7mkeHCUONlAl4nFeVqq3nRZtTb3LJhBBZ5vGP042gLpztn1LowpNTXKvjf+5VJ AAWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678987754; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Uq7nE/DzfEkIETd0TF3h83fIBuNZuqidPfixIYK7CAQ=; b=Aug3ueDvAmAAWOQc+1h2s2lsehFrJTCXrlrd8CAOuqE4+JMjskGIuVRhY3NGfLYqGn 1k9yKFQKYaVVs44zzIqI7yMQtOeBlJxhaHN6ntmCtq3voRzQTjZGVxPyyOUtTA0LbZFr pwxbwf11+mJ/brB/xPFzfrkgvABX3yrvRd2DHdE8bBiaNn9RY2p//BDjJpEV42xairTm 6D2b5J15PKzyhWtO5JvqlmEwQaonJL0AwQvOL9T8PfMR5+ppDeVxvPdlik71/iIfIHwB KHDjGzrKte1P84/86uLMHHSkwMh/rrJ7bGOk1pkyCoGACiqe+QTZFaqKAI8b1JV7OJiL xGzg== X-Gm-Message-State: AO0yUKWe1345CqeAKRwoBwdi1IURnFSPufPrp7QHy7LLIHW8uzmh45TH /jejeNjihWPUrN+ECEWyK34Bl/VfJrm1aA== X-Received: from dlatypov-spec.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:3f35]) (user=dlatypov job=sendgmr) by 2002:a05:6902:2c5:b0:b45:5cbe:48b3 with SMTP id w5-20020a05690202c500b00b455cbe48b3mr6311269ybh.0.1678987754589; Thu, 16 Mar 2023 10:29:14 -0700 (PDT) Date: Thu, 16 Mar 2023 10:28:59 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230316172900.755430-1-dlatypov@google.com> Subject: [PATCH 1/2] kunit: tool: add subscripts for type annotations where appropriate From: Daniel Latypov To: brendanhiggins@google.com, davidgow@google.com Cc: rmoar@google.com, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, Daniel Latypov , Johannes Berg X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760546903598388926?= X-GMAIL-MSGID: =?utf-8?q?1760546903598388926?= E.g. for subprocess.Popen, it can be opened in `text=True` mode where it returns strings, or `text=False` where it returns bytes. To differentiate, you can annotate types as `Popen[str]` or `Popen[bytes]`. This patch should add subscripts in all the places we were missing them. Reported-by: Johannes Berg Link: https://lore.kernel.org/linux-kselftest/20230315105055.9b2be0153625.I7a2cb99b95dff216c0feed4604255275e0b156a7@changeid/ Signed-off-by: Daniel Latypov --- tools/testing/kunit/kunit_kernel.py | 6 +++--- tools/testing/kunit/kunit_printer.py | 2 +- tools/testing/kunit/run_checks.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) base-commit: 2c6a96dad5797e57b4cf04101d6c8d5c7a571603 diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py index 53e90c335834..e6fc8fcb071a 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -92,7 +92,7 @@ class LinuxSourceTreeOperations: if stderr: # likely only due to build warnings print(stderr.decode()) - def start(self, params: List[str], build_dir: str) -> subprocess.Popen: + def start(self, params: List[str], build_dir: str) -> subprocess.Popen[str]: raise RuntimeError('not implemented!') @@ -112,7 +112,7 @@ class LinuxSourceTreeOperationsQemu(LinuxSourceTreeOperations): kconfig.merge_in_entries(base_kunitconfig) return kconfig - def start(self, params: List[str], build_dir: str) -> subprocess.Popen: + def start(self, params: List[str], build_dir: str) -> subprocess.Popen[str]: kernel_path = os.path.join(build_dir, self._kernel_path) qemu_command = ['qemu-system-' + self._qemu_arch, '-nodefaults', @@ -141,7 +141,7 @@ class LinuxSourceTreeOperationsUml(LinuxSourceTreeOperations): kconfig.merge_in_entries(base_kunitconfig) return kconfig - def start(self, params: List[str], build_dir: str) -> subprocess.Popen: + def start(self, params: List[str], build_dir: str) -> subprocess.Popen[str]: """Runs the Linux UML binary. Must be named 'linux'.""" linux_bin = os.path.join(build_dir, 'linux') params.extend(['mem=1G', 'console=tty', 'kunit_shutdown=halt']) diff --git a/tools/testing/kunit/kunit_printer.py b/tools/testing/kunit/kunit_printer.py index 5f1cc55ecdf5..015adf87dc2c 100644 --- a/tools/testing/kunit/kunit_printer.py +++ b/tools/testing/kunit/kunit_printer.py @@ -15,7 +15,7 @@ _RESET = '\033[0;0m' class Printer: """Wraps a file object, providing utilities for coloring output, etc.""" - def __init__(self, output: typing.IO): + def __init__(self, output: typing.IO[str]): self._output = output self._use_color = output.isatty() diff --git a/tools/testing/kunit/run_checks.py b/tools/testing/kunit/run_checks.py index 066e6f938f6d..61cece1684df 100755 --- a/tools/testing/kunit/run_checks.py +++ b/tools/testing/kunit/run_checks.py @@ -37,7 +37,7 @@ def main(argv: Sequence[str]) -> None: if argv: raise RuntimeError('This script takes no arguments') - future_to_name: Dict[futures.Future, str] = {} + future_to_name: Dict[futures.Future[None], str] = {} executor = futures.ThreadPoolExecutor(max_workers=len(commands)) for name, argv in commands.items(): if name in necessary_deps and shutil.which(necessary_deps[name]) is None: From patchwork Thu Mar 16 17:29:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Latypov X-Patchwork-Id: 70929 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp618373wrt; Thu, 16 Mar 2023 10:52:18 -0700 (PDT) X-Google-Smtp-Source: AK7set9oeF13fcN1PUaW3AGabbseLE7ex4t7UBoKxQGhiHUq9uNkMY45GInvs2eWcMKmvNVkQ9GL X-Received: by 2002:a62:7bc7:0:b0:625:5769:aee2 with SMTP id w190-20020a627bc7000000b006255769aee2mr3426120pfc.5.1678989138393; Thu, 16 Mar 2023 10:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678989138; cv=none; d=google.com; s=arc-20160816; b=asUyligMO0LswoLINAmwqSYBQY1k4jarIJJfpP1yztofT71BX+m9xCYxrQww1vocxw p7TSLq5+24dQrAy7c0DAkIVBeujt6i4NVeeYDUOBKa0WPHhEoiqXRmh2Sa6q0uQuBMnn y5Cgs+RDbeBuDArjrDdQRdu0Mt3GEoaX3X4CDpkiX01yuDxGPWnNWqE913a9LxD0bhIH RMu7ZuQwdCt3Opond934LTJNEc3yt3QZRj9n+eRenekmt3KK+qIdFR3usUpJA+wYBBpL EL6URd0blRkT8FMzvzZcDdACcWVV5mg25YD5URNm/nvPfTwLPuh/D/38JW4mmtjEz5iC HloQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=87tojeD1hl3r+GUx070hYtMF9ILSs5cMERcPTVCxRuM=; b=hPL9X0SpJ/kEKxqaCBN844AfgYz7P0HDd2LeF/SD26KAEZ4LLfQOZ8wgV/jKew6DqO FpyBajbn+F+ejQ8r9i9LwAD4WMW6Ox4IFYPp5m6k3X3wt/Qz69eqt8fEH8APsWHHvsvS LU6BNm1MejK5SB8bOxUwubD/ySVRzfQWmG58RPd4CsDVyBX6LVT53O2Qc49EfH8vjEuD DjLiFuNRUXzi/5Kp7MMxAx2dOTYej5KJLYzDcvO4e3E4WuqIc1Ny09pWg+wkk9RpR1mV 1y+lUN+qOlsqbKB1FAeK7GDiY4vv0ll9s3a/BGB8Pt1OyYjRazrcEv9mjn5WoiXXuj9N UaFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aHMVxJZD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fd13-20020a056a002e8d00b005e268568420si41704pfb.23.2023.03.16.10.50.58; Thu, 16 Mar 2023 10:52:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aHMVxJZD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbjCPRaJ (ORCPT + 99 others); Thu, 16 Mar 2023 13:30:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbjCPR3d (ORCPT ); Thu, 16 Mar 2023 13:29:33 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 347E8B9504 for ; Thu, 16 Mar 2023 10:29:17 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-54352648c1eso22119757b3.9 for ; Thu, 16 Mar 2023 10:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1678987756; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=87tojeD1hl3r+GUx070hYtMF9ILSs5cMERcPTVCxRuM=; b=aHMVxJZD2DW3iFMk6TmL8oBPJAFeqAikJ4nTGDGRFnxxnqtQ2GJIdXs09G+X/4WzVH EolIwi5v7QX2Y2F9FeJ972W7TwgchD6Xj4y3HGumhDSsCXdiTvLSAHiorOvEJjtiAa/U 7jPrnf1uCOQCsBELMESaTVnDcmQMKrql2XeIm2aj6w2vX/Ntg+SZu+STY9W67b9pdnP/ AqtBEKNtp+ind7FoI0zwmkeGyrme8GZVsWqjDfHM2ZNog29h01pP44BNCJuKjao5Ex5l JLiBy7IJw694s7thTru85RTcdkWn1Ms2+WaTBffoQXZPOfKM6HGfsdxVm9u3t8EfRrrh QH5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678987756; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=87tojeD1hl3r+GUx070hYtMF9ILSs5cMERcPTVCxRuM=; b=g2pDJy5UQxHUnFvvsgAdUN9FcFLokOMEF93KjQMMjjzZ8LmEAnuyyca8VOPy5QUaDw cxhliiW4nU5TrLpKqXI/eGvjlyizmKWbmXtc78jgIDnRfpdC69ONItqekUrDrrSnVhgi KxmmlI6HJyGivRocu2IH92dSxaQnbhVmF/mm2C6uBk6de1BowtfPNhFYKcwxqdbm4vUY HVO7896UfduhIRU8QeTkUzBo9wiPA46GR/bGIehIlJLyptd8ixJ9WARbaQ4AUYwqtUB0 I73O7gGrH9XyjU/uNV5hY2DUI7XlM2xfcDyucRBBWJO9nKjIbJBQoTvQxh5Q3JL74lQe HVBw== X-Gm-Message-State: AO0yUKVlEyULhZfyiJ/Muo2Zd+wo2enGjzfkdo8xmW5+m/qvSiZW6KPE qbHOmxIJAUFopK2mcMVOPouamGfm4lMY6Q== X-Received: from dlatypov-spec.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:3f35]) (user=dlatypov job=sendgmr) by 2002:a81:ae22:0:b0:541:69f4:f927 with SMTP id m34-20020a81ae22000000b0054169f4f927mr2725264ywh.8.1678987756364; Thu, 16 Mar 2023 10:29:16 -0700 (PDT) Date: Thu, 16 Mar 2023 10:29:00 -0700 In-Reply-To: <20230316172900.755430-1-dlatypov@google.com> Mime-Version: 1.0 References: <20230316172900.755430-1-dlatypov@google.com> X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230316172900.755430-2-dlatypov@google.com> Subject: [PATCH 2/2] kunit: tool: remove unused imports and variables From: Daniel Latypov To: brendanhiggins@google.com, davidgow@google.com Cc: rmoar@google.com, linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, Daniel Latypov X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760547714511860699?= X-GMAIL-MSGID: =?utf-8?q?1760547714511860699?= We don't run a linter regularly over kunit.py code (the default settings on most don't like kernel style, e.g. tabs) so some of these imports didn't get removed when they stopped being used. Signed-off-by: Daniel Latypov --- tools/testing/kunit/kunit.py | 2 +- tools/testing/kunit/kunit_config.py | 2 +- tools/testing/kunit/kunit_kernel.py | 1 - tools/testing/kunit/kunit_parser.py | 1 - tools/testing/kunit/kunit_tool_test.py | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py index 741f15420467..52853634ba23 100755 --- a/tools/testing/kunit/kunit.py +++ b/tools/testing/kunit/kunit.py @@ -123,7 +123,7 @@ def _suites_from_test_list(tests: List[str]) -> List[str]: parts = t.split('.', maxsplit=2) if len(parts) != 2: raise ValueError(f'internal KUnit error, test name should be of the form ".", got "{t}"') - suite, case = parts + suite, _ = parts if not suites or suites[-1] != suite: suites.append(suite) return suites diff --git a/tools/testing/kunit/kunit_config.py b/tools/testing/kunit/kunit_config.py index 48b5f34b2e5d..9f76d7b89617 100644 --- a/tools/testing/kunit/kunit_config.py +++ b/tools/testing/kunit/kunit_config.py @@ -8,7 +8,7 @@ from dataclasses import dataclass import re -from typing import Dict, Iterable, List, Set, Tuple +from typing import Dict, Iterable, List, Tuple CONFIG_IS_NOT_SET_PATTERN = r'^# CONFIG_(\w+) is not set$' CONFIG_PATTERN = r'^CONFIG_(\w+)=(\S+|".*")$' diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py index e6fc8fcb071a..775842b912d8 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -18,7 +18,6 @@ import threading from typing import Iterator, List, Optional, Tuple import kunit_config -from kunit_printer import stdout import qemu_config KCONFIG_PATH = '.config' diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py index a225799f6b1b..fbc094f0567e 100644 --- a/tools/testing/kunit/kunit_parser.py +++ b/tools/testing/kunit/kunit_parser.py @@ -12,7 +12,6 @@ from __future__ import annotations from dataclasses import dataclass import re -import sys import textwrap from enum import Enum, auto diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py index 0c2190514103..be35999bb84f 100755 --- a/tools/testing/kunit/kunit_tool_test.py +++ b/tools/testing/kunit/kunit_tool_test.py @@ -328,7 +328,7 @@ class KUnitParserTest(unittest.TestCase): def test_parse_subtest_header(self): ktap_log = test_data_path('test_parse_subtest_header.log') with open(ktap_log) as file: - result = kunit_parser.parse_run_tests(file.readlines()) + kunit_parser.parse_run_tests(file.readlines()) self.print_mock.assert_any_call(StrContains('suite (1 subtest)')) def test_show_test_output_on_failure(self):