Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kunit: tool: remove unused imports and variables

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>

authored by

Daniel Latypov and committed by
Shuah Khan
126901ba 695e2603

+3 -5
+1 -1
tools/testing/kunit/kunit.py
··· 123 123 parts = t.split('.', maxsplit=2) 124 124 if len(parts) != 2: 125 125 raise ValueError(f'internal KUnit error, test name should be of the form "<suite>.<test>", got "{t}"') 126 - suite, case = parts 126 + suite, _ = parts 127 127 if not suites or suites[-1] != suite: 128 128 suites.append(suite) 129 129 return suites
+1 -1
tools/testing/kunit/kunit_config.py
··· 8 8 9 9 from dataclasses import dataclass 10 10 import re 11 - from typing import Dict, Iterable, List, Set, Tuple 11 + from typing import Dict, Iterable, List, Tuple 12 12 13 13 CONFIG_IS_NOT_SET_PATTERN = r'^# CONFIG_(\w+) is not set$' 14 14 CONFIG_PATTERN = r'^CONFIG_(\w+)=(\S+|".*")$'
-1
tools/testing/kunit/kunit_kernel.py
··· 18 18 from typing import Iterator, List, Optional, Tuple 19 19 20 20 import kunit_config 21 - from kunit_printer import stdout 22 21 import qemu_config 23 22 24 23 KCONFIG_PATH = '.config'
-1
tools/testing/kunit/kunit_parser.py
··· 12 12 from __future__ import annotations 13 13 from dataclasses import dataclass 14 14 import re 15 - import sys 16 15 import textwrap 17 16 18 17 from enum import Enum, auto
+1 -1
tools/testing/kunit/kunit_tool_test.py
··· 328 328 def test_parse_subtest_header(self): 329 329 ktap_log = test_data_path('test_parse_subtest_header.log') 330 330 with open(ktap_log) as file: 331 - result = kunit_parser.parse_run_tests(file.readlines()) 331 + kunit_parser.parse_run_tests(file.readlines()) 332 332 self.print_mock.assert_any_call(StrContains('suite (1 subtest)')) 333 333 334 334 def test_show_test_output_on_failure(self):