From: Dag Sverre Seljebotn Date: Fri, 25 Sep 2009 07:53:32 +0000 (+0200) Subject: Better check for broken NumPy install X-Git-Tag: 0.11.3.rc0~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b22b91af781ebffea0257a4dcfadf49b5cda4e34;p=cython.git Better check for broken NumPy install --- diff --git a/tests/run/numpy_test.pyx b/tests/run/numpy_test.pyx index cc85db7f..c55ed9fc 100644 --- a/tests/run/numpy_test.pyx +++ b/tests/run/numpy_test.pyx @@ -17,6 +17,8 @@ try: import numpy as np __doc__ = u""" + >>> assert_dtype_sizes() + >>> basic() [[0 1 2 3 4] [5 6 7 8 9]] @@ -209,6 +211,20 @@ except: __doc__ = u"" +def assert_dtype_sizes(): + assert sizeof(np.int8_t) == 1 + assert sizeof(np.int16_t) == 2 + assert sizeof(np.int32_t) == 4 + assert sizeof(np.int64_t) == 8 + assert sizeof(np.uint8_t) == 1 + assert sizeof(np.uint16_t) == 2 + assert sizeof(np.uint32_t) == 4 + assert sizeof(np.uint64_t) == 8 + assert sizeof(np.float32_t) == 4 + assert sizeof(np.float64_t) == 8 + assert sizeof(np.complex64_t) == 8 + assert sizeof(np.complex128_t) == 16 + def ndarray_str(arr): u""" Since Py2.3 doctest don't support , manually replace blank lines