summaryrefslogtreecommitdiff
path: root/tests/run/numpy_cimport_5.pyx
blob: 2768f2dae18c45a0c563de36bc85d1b62fabf9ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# mode: run
# tag: warnings, numpy

from numpy cimport ndarray
# np.import_array not called - should generate warning

cdef extern from *:
    """
    static void** _check_array_api(void) {
        return PyArray_API; /* should be non NULL */
    }
    """
    void** _check_array_api()

def check_array_api():
    """
    >>> check_array_api()
    True
    """
    return _check_array_api() != NULL


_WARNINGS = """
4:0: 'numpy.import_array()' has been added automatically since 'numpy' was cimported but 'numpy.import_array' was not called.
"""