[Piglit] [PATCH 7/9] tests/oglconform.py: Fix style issues indentified by pylint

baker.dylan.c at gmail.com baker.dylan.c at gmail.com
Wed Oct 21 11:06:32 PDT 2015


From: Dylan Baker <baker.dylan.c at gmail.com>

- constants should be ALL_CAPS
- shadowing names from the outer scope

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 tests/oglconform.py | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/tests/oglconform.py b/tests/oglconform.py
index ebf2c97..c0ac4a3 100644
--- a/tests/oglconform.py
+++ b/tests/oglconform.py
@@ -31,12 +31,11 @@ from framework.profile import TestProfile, Test
 
 __all__ = ['profile']
 
-bin_oglconform = core.PIGLIT_CONFIG.required_get('oglconform', 'path')
+BIN = core.PIGLIT_CONFIG.required_get('oglconform', 'path')
 
-if not os.path.exists(bin_oglconform):
+if not os.path.exists(BIN):
     raise exceptions.PiglitFatalError(
-        'Cannot find binary {}'.format(bin_oglconform))
-
+        'Cannot find binary {}'.format(BIN))
 
 
 class OGLCTest(Test):
@@ -46,7 +45,6 @@ class OGLCTest(Test):
     will obtain a list of tests from oglconform and add them all.
 
     """
-    _BIN = bin_oglconform
     skip_re = re.compile(r'Total Not run: 1|no test in schedule is '
                          r'compat|GLSL [13].[345]0 is not supported|wont be '
                          r'scheduled due to lack of compatible fbconfig')
@@ -56,7 +54,7 @@ class OGLCTest(Test):
 
     @Test.command.getter
     def command(self):
-        return [self._BIN, '-minFmt', '-v', '4', '-test'] + \
+        return [BIN, '-minFmt', '-v', '4', '-test'] + \
             super(OGLCTest, self).command
 
     def interpret_result(self):
@@ -69,11 +67,12 @@ class OGLCTest(Test):
 
 
 def _make_profile():
-    profile = TestProfile()
+    """Create and populate a TestProfile instance."""
+    profile_ = TestProfile()
 
     with tempfile.NamedTemporaryFile() as f:
         with open(os.devnull, "w") as devnull:
-            subprocess.call([bin_oglconform, '-generateTestList', f.name],
+            subprocess.call([BIN, '-generateTestList', f.name],
                             stdout=devnull.fileno(), stderr=devnull.fileno())
 
         f.seek(0)
@@ -85,9 +84,9 @@ def _make_profile():
                 continue
 
             group = grouptools.join('oglconform', category, test)
-            profile.test_list[group] = OGLCTest(category, test)
+            profile_.test_list[group] = OGLCTest(category, test)
 
-    return profile
+    return profile_
 
 
 profile = _make_profile()  # pylint: disable=invalid-name
-- 
2.6.1



More information about the Piglit mailing list