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

Paul Berry stereotype441 at gmail.com
Tue Oct 22 02:42:53 CEST 2013


On 21 October 2013 17:36, Dylan Baker <baker.dylan.c at gmail.com> wrote:

> 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>
>

Thanks, Dylan!

Tested-by: Paul Berry <stereotype441 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20131021/2b73b2e7/attachment.html>


More information about the Piglit mailing list