]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
patman: test_util: Fix printing results for failed tests
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Sat, 2 Apr 2022 17:06:04 +0000 (20:06 +0300)
committerSimon Glass <sjg@chromium.org>
Tue, 28 Jun 2022 02:09:51 +0000 (03:09 +0100)
When printing a python tool's test results, the entire list of failed
tests and their tracebacks are reprinted for every failed test. This
makes the test output quite unreadable. Fix the loop to print failures
and tracebacks one at a time.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/patman/test_util.py

index c60eb3628e23e522ea9d90dbf84be7242b68032d..8b2220dbbafc4cbf099b2791285504f2ff0f4621 100644 (file)
@@ -127,7 +127,7 @@ def report_result(toolname:str, test_name: str, result: unittest.TestResult):
     for test, err in result.errors:
         print(test.id(), err)
     for test, err in result.failures:
-        print(err, result.failures)
+        print(test.id(), err)
     if result.skipped:
         print('%d %s test%s SKIPPED:' % (len(result.skipped), toolname,
             's' if len(result.skipped) > 1 else ''))