kunit: tool: remove unused imports and variables
authorDaniel Latypov <dlatypov@google.com>
Thu, 16 Mar 2023 22:06:37 +0000 (15:06 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 17 Mar 2023 18:28:25 +0000 (12:28 -0600)
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>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/kunit/kunit.py
tools/testing/kunit/kunit_config.py
tools/testing/kunit/kunit_kernel.py
tools/testing/kunit/kunit_parser.py
tools/testing/kunit/kunit_tool_test.py

index 741f15420467aecda526d84a62935a19ca4ec936..52853634ba2316e0717b25d169e1f9233c7fbb23 100755 (executable)
@@ -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
index 48b5f34b2e5d7b0200f7de193e43f454cc7ac832..9f76d7b896175221173c91a3f249f72c6568b175 100644 (file)
@@ -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+|".*")$'
index e6fc8fcb071a831a0344856fe9fa1e4b51feb79e..775842b912d8e073d615d9368abc1f65044abb1a 100644 (file)
@@ -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'
index a225799f6b1b9e1e8346d10d8655fff8c8922518..fbc094f0567e660c098c0c10acb2b8281cf276f8 100644 (file)
@@ -12,7 +12,6 @@
 from __future__ import annotations
 from dataclasses import dataclass
 import re
-import sys
 import textwrap
 
 from enum import Enum, auto
index 0c2190514103faa78433fe5d2fb15139ae68293f..be35999bb84f14dd2909756fdfa8b0673fdd8f95 100755 (executable)
@@ -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):