From e2488d6b15e06cfbf603c72a99cf03006d2a89d6 Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Sun, 23 Mar 2008 17:16:06 +0000 Subject: Do not fail test when ctypes is not available; print a message about skipping the test instead. --- numpy/tests/test_ctypeslib.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'numpy/tests') 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): -- cgit v1.2.1