On Tuesday, September 16, 2014 06:12:01 PM Ilia Mirkin wrote: > On Tue, Sep 16, 2014 at 5:46 PM, Dylan Baker <[email protected]> wrote: > > In the event that a test does not reach the point of returning a status > > either via interpret_result() or by an early return, the result passed > > to the logger will be the default, which is a Status object. This would > > Sounds like the default shouldn't be a status object then... dealing > with different object types for no good reason seems silly.
You're right of course, although that is a lot more work :) > > > cause an assertion to be triggered that the status was not in the list > > of accepted statuses. > > > > This patch corrects this by explicitly transforming the status into a > > str (via the str() method). > > > > Signed-off-by: Dylan Baker <[email protected]> > > --- > > framework/log.py | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/framework/log.py b/framework/log.py > > index e0f8cf6..4575707 100644 > > --- a/framework/log.py > > +++ b/framework/log.py > > @@ -117,6 +117,8 @@ class Log(object): > > # increment the number of completed tests > > self.__complete += 1 > > > > + # In some cases result can be a framework.status.Status() instance > > + result = str(result) > > assert result in self.__summary_keys, 'Result "{0}" not in > > {1}'.format( > > result, self.__summary_keys) > > self.__summary[result] += 1 > > @@ -129,6 +131,8 @@ class Log(object): > > over it. > > > > """ > > + # In some cases result can be a framework.status.Status() instance > > + result = str(result) > > assert result in self.__summary_keys, 'Result "{0}" not in > > {1}'.format( > > result, self.__summary_keys) > > self.__print(name, result) > > -- > > 2.1.0 > > > > _______________________________________________ > > Piglit mailing list > > [email protected] > > http://lists.freedesktop.org/mailman/listinfo/piglit
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
