diff options
author | mattip <matti.picus@gmail.com> | 2019-11-21 16:42:09 -0800 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-11-21 16:43:30 -0800 |
commit | e4f2e1144c4e78291139157aa5d91ed737869b34 (patch) | |
tree | 334982074c945720e31a526734cbbfcb0ebfef02 /numpy/random/tests | |
parent | 866b3402519d1921db5c8a23d9fecf7addac6049 (diff) | |
download | numpy-e4f2e1144c4e78291139157aa5d91ed737869b34.tar.gz |
TST: skip cffi tests when PYTHONOPTIMIZE>1, pycparser fails
Diffstat (limited to 'numpy/random/tests')
-rw-r--r-- | numpy/random/tests/test_direct.py | 7 | ||||
-rw-r--r-- | numpy/random/tests/test_extending.py | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/numpy/random/tests/test_direct.py b/numpy/random/tests/test_direct.py index 34d7bd278..9f77f0ad2 100644 --- a/numpy/random/tests/test_direct.py +++ b/numpy/random/tests/test_direct.py @@ -1,5 +1,6 @@ import os from os.path import join +import sys import numpy as np from numpy.testing import (assert_equal, assert_allclose, assert_array_equal, @@ -26,6 +27,12 @@ try: except ImportError: MISSING_CTYPES = False +if sys.flags.optimize > 1: + # no docstrings present to inspect when PYTHONOPTIMIZE/Py_OptimizeFlag > 1 + # cffi cannot succeed + MISSING_CFFI = True + + pwd = os.path.dirname(os.path.abspath(__file__)) diff --git a/numpy/random/tests/test_extending.py b/numpy/random/tests/test_extending.py index 607853663..daa153cee 100644 --- a/numpy/random/tests/test_extending.py +++ b/numpy/random/tests/test_extending.py @@ -7,6 +7,11 @@ try: except ImportError: cffi = None +if sys.flags.optimize > 1: + # no docstrings present to inspect when PYTHONOPTIMIZE/Py_OptimizeFlag > 1 + # cffi cannot succeed + cffi = None + try: with warnings.catch_warnings(record=True) as w: # numba issue gh-4733 |