[Python-checkins] cpython (3.4): Issue #19493: Fix two uses of ctypes.test.requires (it's not a decorator)

zach.ware python-checkins at python.org
Wed Jul 23 21:41:01 CEST 2014


http://hg.python.org/cpython/rev/374a9a259c09
changeset:   91801:374a9a259c09
branch:      3.4
parent:      91796:77312eda97d8
user:        Zachary Ware <zachary.ware at gmail.com>
date:        Wed Jul 23 14:39:50 2014 -0500
summary:
  Issue #19493: Fix two uses of ctypes.test.requires (it's not a decorator)
and skip test_win32.FunctionCallTestCase.test_SEH when Python was compiled
in debug configuration or by a non-MSC compiler.

files:
  Lib/ctypes/test/test_python_api.py |  2 +-
  Lib/ctypes/test/test_win32.py      |  5 ++++-
  2 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Lib/ctypes/test/test_python_api.py b/Lib/ctypes/test/test_python_api.py
--- a/Lib/ctypes/test/test_python_api.py
+++ b/Lib/ctypes/test/test_python_api.py
@@ -42,9 +42,9 @@
     # This test is unreliable, because it is possible that code in
     # unittest changes the refcount of the '42' integer.  So, it
     # is disabled by default.
-    @requires("refcount")
     @support.refcount_test
     def test_PyLong_Long(self):
+        requires("refcount")
         ref42 = grc(42)
         pythonapi.PyLong_FromLong.restype = py_object
         self.assertEqual(pythonapi.PyLong_FromLong(42), 42)
diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py
--- a/Lib/ctypes/test/test_win32.py
+++ b/Lib/ctypes/test/test_win32.py
@@ -38,8 +38,11 @@
 
 @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
 class FunctionCallTestCase(unittest.TestCase):
-    @requires("SEH")
+    @unittest.skipUnless('MSC' in sys.version, "SEH only supported by MSC")
+    @unittest.skipIf(sys.executable.endswith('_d.exe'),
+                     "SEH not enabled in debug builds")
     def test_SEH(self):
+        requires("SEH")
         # Call functions with invalid arguments, and make sure
         # that access violations are trapped and raise an
         # exception.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list