The list comprehension can be further refined to be fixed, but the resulting code is much more difficult to read than the try/except statement.
This reverts commit aaae592490a6459aba52bc306b819a7fcbaa3008. This reverts commit 450935b06f8508d3f4177fe7336e3bdee3973a9e. CC: Paul Berry <[email protected]> Signed-off-by: Dylan Baker <[email protected]> --- framework/summary.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/framework/summary.py b/framework/summary.py index 3e5c24e..6084621 100644 --- a/framework/summary.py +++ b/framework/summary.py @@ -361,8 +361,12 @@ class Summary: # Create the lists of statuses like problems, regressions, fixes, # changes and skips for test in self.tests['all']: - status = [i.tests.get('test', {}).get('result', so.NotRun()) - for i in self.results] + status = [] + for each in self.results: + try: + status.append(each.tests[test]['result']) + except KeyError: + status.append(so.NotRun()) # Problems include: warn, dmesg-warn, fail, dmesg-fail, and crash. # Skip does not go on this page, it has the 'skipped' page -- 1.8.1.5 _______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
