summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-07-06 08:28:14 (GMT)
committerThomas Heller <theller@ctypes.org>2006-07-06 08:28:14 (GMT)
commit2329b64c20d0c8891102aa2fb65c836efeea3d7c (patch)
tree85983f723e6d91ea1f81987b4bed31dc46cf7c98
parent5953baca0a1f27b861f9db42a68f7777a62b4a3c (diff)
downloadcpython-2329b64c20d0c8891102aa2fb65c836efeea3d7c.zip
cpython-2329b64c20d0c8891102aa2fb65c836efeea3d7c.tar.gz
cpython-2329b64c20d0c8891102aa2fb65c836efeea3d7c.tar.bz2
The test that calls a function with invalid arguments and catches the
resulting Windows access violation will not be run by default.
-rw-r--r--Lib/ctypes/test/test_win32.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py
index 8247d37..db530d3 100644
--- a/Lib/ctypes/test/test_win32.py
+++ b/Lib/ctypes/test/test_win32.py
@@ -1,6 +1,7 @@
# Windows specific tests
from ctypes import *
+from ctypes.test import is_resource_enabled
import unittest, sys
import _ctypes_test
@@ -30,15 +31,10 @@ if sys.platform == "win32":
# or wrong calling convention
self.assertRaises(ValueError, IsWindow, None)
- def test_SEH(self):
- # Call functions with invalid arguments, and make sure that access violations
- # are trapped and raise an exception.
- #
- # Normally, in a debug build of the _ctypes extension
- # module, exceptions are not trapped, so we can only run
- # this test in a release build.
- import sys
- if not hasattr(sys, "getobjects"):
+ if is_resource_enabled("SEH"):
+ def test_SEH(self):
+ # Call functions with invalid arguments, and make sure that access violations
+ # are trapped and raise an exception.
self.assertRaises(WindowsError, windll.kernel32.GetModuleHandleA, 32)
class Structures(unittest.TestCase):