All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gow <davidgow@google.com>
To: Daniel Latypov <dlatypov@google.com>
Cc: brendanhiggins@google.com, rmoar@google.com,
	linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com,
	linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org,
	johannes@sipsolutions.net
Subject: Re: [PATCH v2 2/3] kunit: tool: remove unused imports and variables
Date: Fri, 17 Mar 2023 13:47:24 +0800	[thread overview]
Message-ID: <CABVgOSk3BOyNsV77YohgV5L8cN+j67m7PNa36HFhdb5vN2SRtQ@mail.gmail.com> (raw)
In-Reply-To: <20230316220638.983743-2-dlatypov@google.com>

[-- Attachment #1: Type: text/plain, Size: 3711 bytes --]

On Fri, 17 Mar 2023 at 06:06, Daniel Latypov <dlatypov@google.com> wrote:
>
> 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 <dlatypov@google.com>
> ---

While personally, I don't lose sleep over the occasional unused
variable, these (and particularly the imports) seem sensible.

Reviewed-by: David Gow <davidgow@google.com>

Cheers,
-- David

> Note: this is unchanged, just added a 3rd patch to this series.
> ---
>  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 "<suite>.<test>", 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):
> --
> 2.40.0.rc1.284.g88254d51c5-goog
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4003 bytes --]

  reply	other threads:[~2023-03-17  5:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-16 22:06 [PATCH v2 1/3] kunit: tool: add subscripts for type annotations where appropriate Daniel Latypov
2023-03-16 22:06 ` [PATCH v2 2/3] kunit: tool: remove unused imports and variables Daniel Latypov
2023-03-17  5:47   ` David Gow [this message]
2023-03-16 22:06 ` [PATCH v2 3/3] kunit: tool: fix pre-existing `mypy --strict` errors and update run_checks.py Daniel Latypov
2023-03-17  5:50   ` David Gow
2023-03-17  5:45 ` [PATCH v2 1/3] kunit: tool: add subscripts for type annotations where appropriate David Gow
2023-04-30 18:15 ` SeongJae Park
2023-04-30 21:34   ` Daniel Latypov
2023-05-01 17:15     ` SeongJae Park
2023-05-01 18:19       ` Daniel Latypov

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=CABVgOSk3BOyNsV77YohgV5L8cN+j67m7PNa36HFhdb5vN2SRtQ@mail.gmail.com \
    --to=davidgow@google.com \
    --cc=brendanhiggins@google.com \
    --cc=dlatypov@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=rmoar@google.com \
    --cc=skhan@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.