mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
efa9c805b1
commit
88b2b45154
|
@ -42,9 +42,9 @@ class PythonAPITestCase(unittest.TestCase):
|
||||||
# This test is unreliable, because it is possible that code in
|
# This test is unreliable, because it is possible that code in
|
||||||
# unittest changes the refcount of the '42' integer. So, it
|
# unittest changes the refcount of the '42' integer. So, it
|
||||||
# is disabled by default.
|
# is disabled by default.
|
||||||
@requires("refcount")
|
|
||||||
@support.refcount_test
|
@support.refcount_test
|
||||||
def test_PyLong_Long(self):
|
def test_PyLong_Long(self):
|
||||||
|
requires("refcount")
|
||||||
ref42 = grc(42)
|
ref42 = grc(42)
|
||||||
pythonapi.PyLong_FromLong.restype = py_object
|
pythonapi.PyLong_FromLong.restype = py_object
|
||||||
self.assertEqual(pythonapi.PyLong_FromLong(42), 42)
|
self.assertEqual(pythonapi.PyLong_FromLong(42), 42)
|
||||||
|
|
|
@ -38,8 +38,11 @@ class WindowsTestCase(unittest.TestCase):
|
||||||
|
|
||||||
@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
|
@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test')
|
||||||
class FunctionCallTestCase(unittest.TestCase):
|
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):
|
def test_SEH(self):
|
||||||
|
requires("SEH")
|
||||||
# Call functions with invalid arguments, and make sure
|
# Call functions with invalid arguments, and make sure
|
||||||
# that access violations are trapped and raise an
|
# that access violations are trapped and raise an
|
||||||
# exception.
|
# exception.
|
||||||
|
|
Loading…
Reference in New Issue