[Piglit] [Patch v2 01/13] framework/exectest.py: Fix a few pylint warnings

Dylan Baker baker.dylan.c at gmail.com
Tue May 13 11:38:34 PDT 2014


This removes some unreachable code, adds an name definition to the Test
constructor, and comments a bare except. There are only a couple of
cases where a bare except is appropriate, most of the time it is a
problem, but we are using one the few cases where it is okay, we're
logging all exceptions to a file.

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

diff --git a/framework/exectest.py b/framework/exectest.py
index 3056a78..18f4818 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -45,7 +45,7 @@ if 'PIGLIT_BUILD_DIR' in os.environ:
     TEST_BIN_DIR = os.path.join(os.environ['PIGLIT_BUILD_DIR'], 'bin')
 else:
     TEST_BIN_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__),
-                                               '../bin'))
+                                                 '../bin'))
 
 
 class Test(object):
@@ -57,6 +57,7 @@ class Test(object):
                 execute it's work (i.e. __doRunWork) on the calling thread
                 (i.e. the main thread) or from the ConcurrentTestPool threads.
         '''
+        self._command = None
         self.run_concurrent = run_concurrent
         self.command = command
         self.env = {}
@@ -86,6 +87,8 @@ class Test(object):
                 self.run()
                 self.result['time'] = time.time() - time_start
                 self.result = dmesg.update_result(self.result)
+            # This is a rare case where a bare exception is okay, since we're
+            # using it to log exceptions
             except:
                 exception = sys.exc_info()
                 self.result['result'] = 'fail'
@@ -124,7 +127,6 @@ class Test(object):
 
     def interpret_result(self):
         raise NotImplementedError
-        return out
 
     def run(self):
         """
-- 
2.0.0.rc2



More information about the Piglit mailing list