diff options
author | mattip <matti.picus@gmail.com> | 2018-11-22 11:36:12 -0600 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2018-11-22 15:03:17 -0600 |
commit | 51e9a0283e3a0919ffb3e0243c605d0d4a6d3c47 (patch) | |
tree | 1437c1ac67ec122c6a71df725794fabbc7f60c37 /numpy/tests | |
parent | f01924f92208cc8b40c5830bb240b3c26cbaea08 (diff) | |
download | numpy-51e9a0283e3a0919ffb3e0243c605d0d4a6d3c47.tar.gz |
BUG: test, fix NPY_VISIBILITY_HIDDEN on gcc, which becomes NPY_NO_EXPORT
Diffstat (limited to 'numpy/tests')
-rw-r--r-- | numpy/tests/test_public_api.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/numpy/tests/test_public_api.py b/numpy/tests/test_public_api.py index 856cca8eb..194f8ecbb 100644 --- a/numpy/tests/test_public_api.py +++ b/numpy/tests/test_public_api.py @@ -4,7 +4,10 @@ import sys import numpy as np import pytest - +try: + import ctypes +except ImportError: + ctypes = None def check_dir(module, module_name=None): """Returns a mapping of all objects with the wrong __module__ attribute.""" @@ -75,3 +78,12 @@ def test_numpy_linalg(): def test_numpy_fft(): bad_results = check_dir(np.fft) assert bad_results == {} + +@pytest.mark.skipif(ctypes is None, + reason="ctypes not available in this python") +def test_NPY_NO_EXPORT(): + cdll = ctypes.CDLL(np.core._multiarray_tests.__file__) + # Make sure an arbitrary NPY_NO_EXPORT function is actually hidden + f = getattr(cdll, 'test_not_exported', None) + assert f is None, ("'test_not_exported' is mistakenly exported, " + "NPY_NO_EXPORT does not work") |