From: Dylan Baker <baker.dyla...@gmail.com>

Also fix unittest that relied on compare to None having python 2
behavior.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/test/base.py        | 5 +++++
 unittests/oglconform_tests.py | 1 +
 2 files changed, 6 insertions(+)

diff --git a/framework/test/base.py b/framework/test/base.py
index 159ab50..0fe0f74 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -133,6 +133,11 @@ def is_crash_returncode(returncode):
     """Determine whether the given process return code correspond to a
     crash.
     """
+    # In python 2 NoneType and other types can be compaired, in python3 this
+    # isn't allowed.
+    if returncode is None:
+        return False
+
     if sys.platform == 'win32':
         # On Windows:
         # - For uncaught exceptions the process terminates with the exception
diff --git a/unittests/oglconform_tests.py b/unittests/oglconform_tests.py
index bcc6eae..6dbe40b 100644
--- a/unittests/oglconform_tests.py
+++ b/unittests/oglconform_tests.py
@@ -154,6 +154,7 @@ def test_oglctest_interpret_result_fail():
 def test_oglctest_interpret_result_crash():
     """tests.oglconform.OGLCtest.interpret_result: status is crash if 
returncode is not 0"""
     test = oglconform.OGLCTest('group', 'test')
+    test.result.returncode = -1
     test.interpret_result()
 
     nt.eq_(test.result.result, 'crash')
-- 
2.7.0

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to