diff options
author | Daniel Latypov <dlatypov@google.com> | 2022-11-03 10:47:38 -0700 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2022-12-12 14:13:47 -0700 |
commit | f473dd9488d910aab109e8c6a2e4181125ca322a (patch) | |
tree | 611c846a1f883dcf850a081d62a68942ba33fad4 /tools/testing/kunit/kunit_tool_test.py | |
parent | kunit: tool: print summary of failed tests if a few failed out of a lot (diff) | |
download | wireguard-linux-f473dd9488d910aab109e8c6a2e4181125ca322a.tar.xz wireguard-linux-f473dd9488d910aab109e8c6a2e4181125ca322a.zip |
kunit: tool: make TestCounts a dataclass
Since we're using Python 3.7+, we can use dataclasses to tersen the
code.
It also lets us create pre-populated TestCounts() objects and compare
them in our unit test. (Before, you could only create empty ones).
Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/kunit/kunit_tool_test.py')
-rwxr-xr-x | tools/testing/kunit/kunit_tool_test.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py index 7dcd67003b23..440a273f1d21 100755 --- a/tools/testing/kunit/kunit_tool_test.py +++ b/tools/testing/kunit/kunit_tool_test.py @@ -182,9 +182,7 @@ class KUnitParserTest(unittest.TestCase): kunit_parser.extract_tap_lines( file.readlines())) # A missing test plan is not an error. - self.assertEqual(0, result.counts.errors) - # All tests should be accounted for. - self.assertEqual(10, result.counts.total()) + self.assertEqual(result.counts, kunit_parser.TestCounts(passed=10, errors=0)) self.assertEqual( kunit_parser.TestStatus.SUCCESS, result.status) |