diff options
| author | Daniel Latypov <dlatypov@google.com> | 2021-01-14 16:39:11 -0800 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2021-01-15 17:49:34 -0700 |
| commit | 09641f7c7d8f1309fe9ad9ce4e6a1697016d73ba (patch) | |
| tree | 2e2ddefcced15944e0f60ab1b9f87a18f2648bfe /tools/testing/kunit/kunit_json.py | |
| parent | 8db50be262e9faf59fa0feb74599c29b64eb0af2 (diff) | |
kunit: tool: surface and address more typing issues
The authors of this tool were more familiar with a different
type-checker, https://github.com/google/pytype.
That's open source, but mypy seems more prevalent (and runs faster).
And unlike pytype, mypy doesn't try to infer types so it doesn't check
unanotated functions.
So annotate ~all functions in kunit tool to increase type-checking
coverage.
Note: per https://www.python.org/dev/peps/pep-0484/, `__init__()` should
be annotated as `-> None`.
Doing so makes mypy discover a number of new violations.
Exclude main() since we reuse `request` for the different types of
requests, which mypy isn't happy about.
This commit fixes all but one error, where `TestSuite.status` might be
None.
Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>
Acked-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/kunit/kunit_json.py')
| -rw-r--r-- | tools/testing/kunit/kunit_json.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/kunit/kunit_json.py b/tools/testing/kunit/kunit_json.py index 624b31b2dbd6..f5cca5c38cac 100644 --- a/tools/testing/kunit/kunit_json.py +++ b/tools/testing/kunit/kunit_json.py @@ -13,7 +13,7 @@ import kunit_parser from kunit_parser import TestStatus -def get_json_result(test_result, def_config, build_dir, json_path): +def get_json_result(test_result, def_config, build_dir, json_path) -> str: sub_groups = [] # Each test suite is mapped to a KernelCI sub_group |