diff options
author | Pauli Virtanen <pav@iki.fi> | 2018-03-12 22:47:12 +0000 |
---|---|---|
committer | Nathaniel J. Smith <njs@pobox.com> | 2018-03-12 15:47:12 -0700 |
commit | e97de95d4cae6805ed6c258655e7492a5f2ce863 (patch) | |
tree | ffea6426cc80a5f6f8f77a73b219ef3aac840c15 /numpy/testing/nose_tools | |
parent | 5324067c702a41e901354a01a5f0d05ff49b6cb4 (diff) | |
download | numpy-e97de95d4cae6805ed6c258655e7492a5f2ce863.tar.gz |
Fix low-hanging Pypy compatibility issues (#10737)
* TST: skip refcount-requiring tests if sys.refcount is missing
* ENH: io: add refcheck=False to a safe .resize() call
The array is allocated immediately above, and the resize always succeeds
so it is not necessary to check it. Fixes Pypy compatibility.
* TST: remove unused code
* TST: factor skipif(not HAS_REFCOUNT) into a separate decorator
Diffstat (limited to 'numpy/testing/nose_tools')
-rw-r--r-- | numpy/testing/nose_tools/decorators.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/testing/nose_tools/decorators.py b/numpy/testing/nose_tools/decorators.py index 243c0c8c1..dda2c1b74 100644 --- a/numpy/testing/nose_tools/decorators.py +++ b/numpy/testing/nose_tools/decorators.py @@ -17,10 +17,10 @@ from __future__ import division, absolute_import, print_function import collections -from .utils import SkipTest, assert_warns +from .utils import SkipTest, assert_warns, HAS_REFCOUNT __all__ = ['slow', 'setastest', 'skipif', 'knownfailureif', 'deprecated', - 'parametrize',] + 'parametrize', '_needs_refcount',] def slow(t): @@ -283,3 +283,5 @@ def parametrize(vars, input): from .parameterized import parameterized return parameterized(input) + +_needs_refcount = skipif(not HAS_REFCOUNT, "python has no sys.getrefcount") |