]> granicus.if.org Git - python/commitdiff
Issue #19493: Fix two uses of ctypes.test.requires (it's not a decorator)
authorZachary Ware <zachary.ware@gmail.com>
Wed, 23 Jul 2014 19:29:25 +0000 (14:29 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 23 Jul 2014 19:29:25 +0000 (14:29 -0500)
and skip test_win32.FunctionCallTestCase.test_SEH when Python was compiled
in debug configuration or by a non-MSC compiler.

Lib/ctypes/test/test_python_api.py
Lib/ctypes/test/test_win32.py

index 62728ddf5fef8a0dffbf83231e816b80f94cdf66..bc2ffd0e0c162363d4f9883fb474d966adccba34 100644 (file)
@@ -40,8 +40,8 @@ class PythonAPITestCase(unittest.TestCase):
     # 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")
     def test_PyInt_Long(self):
+        requires("refcount")
         ref42 = grc(42)
         pythonapi.PyInt_FromLong.restype = py_object
         self.assertEqual(pythonapi.PyInt_FromLong(42), 42)
index 8093efcc75ce684c8523224acb5e0f3f6bb7aad1..2dd7b4503afd7e58bb3c4d335673b4014ec4d3c7 100644 (file)
@@ -38,8 +38,11 @@ class WindowsTestCase(unittest.TestCase):
 
 @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.