summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchanley <chanley@gmail.com>2010-12-27 12:16:14 -0500
committerchanley <chanley@gmail.com>2010-12-27 12:16:14 -0500
commit945126079dd1e48c96629799108a3dec91809085 (patch)
tree8240e06a94c4600ae4fd12fae123629d6a54338c
parent799179d1466f274dfef66d6aeea394b2c7cff729 (diff)
downloadnumpy-945126079dd1e48c96629799108a3dec91809085.tar.gz
Apply patch by bsouthey in Ticket #1475 to turn off appropriate tests when ctypes
is not installed. This is of particular importance to STScI since this test is breaking our nightly build/test setup.
-rw-r--r--numpy/lib/tests/test_type_check.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_type_check.py b/numpy/lib/tests/test_type_check.py
index 888c60420..941768aa5 100644
--- a/numpy/lib/tests/test_type_check.py
+++ b/numpy/lib/tests/test_type_check.py
@@ -3,6 +3,13 @@ from numpy.lib import *
from numpy.core import *
from numpy.compat import asbytes
+try:
+ import ctypes
+ _HAS_CTYPE = True
+except ImportError:
+ _HAS_CTYPE = False
+
+
def assert_all(x):
assert(all(x)), x
@@ -375,9 +382,9 @@ class TestArrayConversion(TestCase):
assert_equal(a.__class__,ndarray)
assert issubdtype(a.dtype,float)
-
class TestDateTimeData:
+ @dec.skipif(not _HAS_CTYPE, "ctypes not available on this python installation")
def test_basic(self):
a = array(['1980-03-23'], dtype=datetime64)
assert_equal(datetime_data(a.dtype), (asbytes('us'), 1, 1, 1))