summaryrefslogtreecommitdiff
path: root/numpy/tests
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-03-12 14:17:09 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-03-12 14:17:09 +0000
commit3042a38b466f2a79a165ecbe1b9c87124ae3e93a (patch)
tree4e40abd406cf8c74e7b681626d0432294bee3b53 /numpy/tests
parent6f60d2c76ece73e8f37f2ae1014cc26b485495d0 (diff)
downloadnumpy-3042a38b466f2a79a165ecbe1b9c87124ae3e93a.tar.gz
Skip graciously when ctypes is not available.
Diffstat (limited to 'numpy/tests')
-rw-r--r--numpy/tests/test_ctypeslib.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/tests/test_ctypeslib.py b/numpy/tests/test_ctypeslib.py
index aad6c96af..832ce683c 100644
--- a/numpy/tests/test_ctypeslib.py
+++ b/numpy/tests/test_ctypeslib.py
@@ -4,7 +4,14 @@ import numpy as np
from numpy.ctypeslib import ndpointer, load_library
from numpy.testing import *
+try:
+ cdll = load_library('multiarray', np.core.multiarray.__file__)
+ _HAS_CTYPE = True
+except ImportError:
+ _HAS_CTYPE = False
+
class TestLoadLibrary(TestCase):
+ @dec.skipif(not _HAS_CTYPE, "ctypes not available on this python installation")
@dec.knownfailureif(sys.platform=='cygwin', "This test is known to fail on cygwin")
def test_basic(self):
try:
@@ -15,6 +22,7 @@ class TestLoadLibrary(TestCase):
" (import error was: %s)" % str(e)
print msg
+ @dec.skipif(not _HAS_CTYPE, "ctypes not available on this python installation")
@dec.knownfailureif(sys.platform=='cygwin', "This test is known to fail on cygwin")
def test_basic2(self):
"""Regression for #801: load_library with a full library name