[Piglit] [PATCH 11/13] framework/exectest.py: Test.execute() remove if's that are constant

Dylan Baker baker.dylan.c at gmail.com
Tue Apr 15 16:12:44 PDT 2014


There are a couple of if checks in Test.execute() that will always have
the same truth value. Remove completely the ones that are always false,
and unconditionally run the ones that are true.

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/exectest.py | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/framework/exectest.py b/framework/exectest.py
index fe82181..9eedcc4 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -83,17 +83,10 @@ class Test(object):
                 dmesg.update_dmesg()
                 self._test_hook_execute_run()
                 self.run()
+                self.result['time'] = time.time() - time_start
                 self.result = dmesg.update_result(self.result)
-                time_end = time.time()
-                if 'time' not in self.result:
-                    self.result['time'] = time_end - time_start
                 if 'result' not in self.result:
                     self.result['result'] = 'fail'
-                if not isinstance(self.result, TestResult):
-                    self.result = TestResult(self.result)
-                    self.result['result'] = 'warn'
-                    self.result['note'] = ('Result not returned as an '
-                                            'instance of TestResult')
             except:
                 exception = sys.exc_info()
                 self.result['result'] = 'fail'
-- 
1.9.2



More information about the Piglit mailing list