diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-11-19 07:44:44 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2019-11-19 07:44:44 -0700 |
commit | d6ecf67f88fb61cf641e2370d3e54938232de09d (patch) | |
tree | 08223e6b70fd71d0b11d378ca02f96d56c715d74 /numpy/random/tests/test_extending.py | |
parent | 53201578225cc89d383738598acec03572554019 (diff) | |
download | numpy-d6ecf67f88fb61cf641e2370d3e54938232de09d.tar.gz |
API: restructure and document numpy.random C-API (#14604)
* API: restructure and document numpy.random C-API
* DOC: fix bad reference
* API: ship, document, and start to test numpy.random C-API examples
* API, DOC, TST: fix tests, refactor documentation to include snippets
* BUILD: move public headers to numpy/core/include/numpy/random
* TST: ignore DeprecationWarnings in setuptools and numba
* DOC: document the C-API as used from Cython
Diffstat (limited to 'numpy/random/tests/test_extending.py')
-rw-r--r-- | numpy/random/tests/test_extending.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/numpy/random/tests/test_extending.py b/numpy/random/tests/test_extending.py new file mode 100644 index 000000000..01e43b9e8 --- /dev/null +++ b/numpy/random/tests/test_extending.py @@ -0,0 +1,32 @@ +import os, sys +import pytest +import warnings + +try: + with warnings.catch_warnings(record=True) as w: + # numba issue gh-4733 + warnings.filterwarnings('always', '', DeprecationWarning) + import numba + import cffi +except ImportError: + numba = None + +def test_cython(): + curdir = os.getcwd() + argv = sys.argv + examples = (os.path.dirname(__file__), '..', 'examples') + try: + os.chdir(os.path.join(*examples)) + sys.argv = argv[:1] + ['build'] + with warnings.catch_warnings(record=True) as w: + # setuptools issue gh-1885 + warnings.filterwarnings('always', '', DeprecationWarning) + from numpy.random.examples.cython import setup + finally: + sys.argv = argv + os.chdir(curdir) + +@pytest.mark.skipif(numba is None, reason="requires numba") +def test_numba(): + from numpy.random.examples.numba import extending + |