kunit: tool: misc cleanups
authorDaniel Latypov <dlatypov@google.com>
Mon, 9 May 2022 20:49:09 +0000 (13:49 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 16 May 2022 19:22:36 +0000 (13:22 -0600)
commit0453f984a7b9458f0e469afb039f2841308b1bef
tree37cbf2c09f11c5b0482c7b8ffa096e6d48571307
parent94507ee3e9aeafc5fcc429947b84016eabea6e64
kunit: tool: misc cleanups

This primarily comes from running pylint over kunit tool code and
ignoring some warnings we don't care about.
If we ever got a fully clean setup, we could add this to run_checks.py,
but we're not there yet.

Fix things like
* Drop unused imports
* check `is None`, not `== None` (see PEP 8)
* remove redundant parens around returns
* remove redundant `else` / convert `elif` to `if` where appropriate
* rename make_arch_qemuconfig() param to base_kunitconfig (this is the
  name used in the subclass, and it's a better one)
* kunit_tool_test: check the exit code for SystemExit (could be 0)

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@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_json.py
tools/testing/kunit/kunit_kernel.py
tools/testing/kunit/kunit_parser.py
tools/testing/kunit/kunit_tool_test.py
tools/testing/kunit/run_checks.py