Skip to content

Commit

Permalink
kunit: tool: remove unused imports and variables
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Latypov authored and Shuah Khan committed Mar 17, 2023
1 parent 695e260 commit 126901b
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/testing/kunit/kunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/testing/kunit/kunit_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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+|".*")$'
Expand Down
1 change: 0 additions & 1 deletion tools/testing/kunit/kunit_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from typing import Iterator, List, Optional, Tuple

import kunit_config
from kunit_printer import stdout
import qemu_config

KCONFIG_PATH = '.config'
Expand Down
1 change: 0 additions & 1 deletion tools/testing/kunit/kunit_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from __future__ import annotations
from dataclasses import dataclass
import re
import sys
import textwrap

from enum import Enum, auto
Expand Down
2 changes: 1 addition & 1 deletion tools/testing/kunit/kunit_tool_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def test_ktap_format(self):
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):
Expand Down

0 comments on commit 126901b

Please sign in to comment.