[Piglit] [PATCH] summary.py: Fix empty generation of problems, changes, etc

Dylan Baker baker.dylan.c at gmail.com
Tue Oct 22 02:36:03 CEST 2013


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 <stereotype441 at gmail.com>
Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 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



More information about the Piglit mailing list