[Piglit] [PATCH 1/2] framework/log.py: Add a message to an assert

Vinson Lee vlee at freedesktop.org
Tue Dec 15 19:22:27 PST 2015


On Mon, Dec 14, 2015 at 3:40 PM,  <baker.dylan.c at gmail.com> wrote:
> From: Dylan Baker <baker.dylan.c at gmail.com>
>
> I hit this assert debugging a problem, and found the lack of a message
> detailing the assert annoying.
>
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> ---
>  framework/log.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/framework/log.py b/framework/log.py
> index e80f48e..20a9897 100644
> --- a/framework/log.py
> +++ b/framework/log.py
> @@ -136,7 +136,8 @@ class QuietLog(BaseLog):
>          self._state['complete'] += 1
>
>          # Add to the summary dict
> -        assert status in self.SUMMARY_KEYS
> +        assert status in self.SUMMARY_KEYS, \
> +            'Invalid status for logger: {}'.format(status)
>          self._state['summary'][status] += 1
>
>          self._print_summary()
> --
> 2.6.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit

Reviewed-by: Vinson Lee <vlee at freedesktop.org>


More information about the Piglit mailing list