From b22b91af781ebffea0257a4dcfadf49b5cda4e34 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Fri, 25 Sep 2009 09:53:32 +0200 Subject: [PATCH] Better check for broken NumPy install --- tests/run/numpy_test.pyx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- 2.26.2