diff options
author | David Cournapeau <cournape@gmail.com> | 2008-03-23 17:16:06 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-03-23 17:16:06 +0000 |
commit | e2488d6b15e06cfbf603c72a99cf03006d2a89d6 (patch) | |
tree | 503e83cd73cbb9eecd879d2c56afec06c3be5899 | |
parent | 48256603928421062e8d3f6b1c9ccb4a9d623277 (diff) | |
download | numpy-e2488d6b15e06cfbf603c72a99cf03006d2a89d6.tar.gz |
Do not fail test when ctypes is not available; print a message about skipping the test instead.
-rw-r--r-- | numpy/tests/test_ctypeslib.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/numpy/tests/test_ctypeslib.py b/numpy/tests/test_ctypeslib.py index 530764193..ceb574911 100644 --- a/numpy/tests/test_ctypeslib.py +++ b/numpy/tests/test_ctypeslib.py @@ -4,8 +4,13 @@ from numpy.testing import * class TestLoadLibrary(NumpyTestCase): def check_basic(self): - cdll = load_library('multiarray', - np.core.multiarray.__file__) + try: + cdll = load_library('multiarray', + np.core.multiarray.__file__) + except ImportError, e: + msg = "ctypes is not available on this python: skipping the test" \ + " (import error was: %s)" % str(e) + print msg class TestNdpointer(NumpyTestCase): def check_dtype(self): |