aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-10 23:36:05 -0500
committerDave Wallace <dwallacelf@gmail.com>2020-01-16 15:55:12 +0000
commit67a7749cac97e7a5fe24984d1770889a3203db95 (patch)
treea93dab841c07b652e3b18f2c481af0c74f15fdf1
parent56cef059ef44434efe26d523caec1bb0af9c1d3b (diff)
tests: fix TypeError in run_tests.py
Traceback (most recent call last): File "run_tests.py", line 886, in <module> exit_code, suites = parse_results(results) File "run_tests.py", line 732, in parse_results results_per_suite.print_results() File "run_tests.py", line 683, in print_results result.get_testcase_names(failed_test_id) TypeError: 'NoneType' object is not iterable Type: test Change-Id: I2c5ae0b9e11be6bfb4490d9ce057db0b0a84c9bf Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
-rw-r--r--test/run_tests.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/run_tests.py b/test/run_tests.py
index 8024696def4..499d6df1290 100644
--- a/test/run_tests.py
+++ b/test/run_tests.py
@@ -646,7 +646,7 @@ class AllResults(dict):
failed_testcase_ids = result[FAIL]
errored_testcase_ids = result[ERROR]
old_testcase_name = None
- if failed_testcase_ids or errored_testcase_ids:
+ if failed_testcase_ids:
for failed_test_id in failed_testcase_ids:
new_testcase_name, test_name = \
result.get_testcase_names(failed_test_id)
@@ -656,15 +656,16 @@ class AllResults(dict):
old_testcase_name = new_testcase_name
print(' FAILURE: {} [{}]'.format(
colorize(test_name, RED), failed_test_id))
- for failed_test_id in errored_testcase_ids:
+ if errored_testcase_ids:
+ for errored_test_id in errored_testcase_ids:
new_testcase_name, test_name = \
- result.get_testcase_names(failed_test_id)
+ result.get_testcase_names(errored_test_id)
if new_testcase_name != old_testcase_name:
print(' Testcase name: {}'.format(
colorize(new_testcase_name, RED)))
old_testcase_name = new_testcase_name
print(' ERROR: {} [{}]'.format(
- colorize(test_name, RED), failed_test_id))
+ colorize(test_name, RED), errored_test_id))
if self.testsuites_no_tests_run:
print('TESTCASES WHERE NO TESTS WERE SUCCESSFULLY EXECUTED:')
tc_classes = set()