summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2018-03-12 22:47:12 +0000
committerNathaniel J. Smith <njs@pobox.com>2018-03-12 15:47:12 -0700
commite97de95d4cae6805ed6c258655e7492a5f2ce863 (patch)
treeffea6426cc80a5f6f8f77a73b219ef3aac840c15 /numpy/lib/tests/test_function_base.py
parent5324067c702a41e901354a01a5f0d05ff49b6cb4 (diff)
downloadnumpy-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/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 49b450175..2b1ac1cc0 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -11,7 +11,7 @@ from numpy.testing import (
run_module_suite, assert_, assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal, assert_raises,
assert_allclose, assert_array_max_ulp, assert_warns, assert_raises_regex,
- dec, suppress_warnings, HAS_REFCOUNT,
+ dec, suppress_warnings,
)
import numpy.lib.function_base as nfb
from numpy.random import rand
@@ -2141,7 +2141,7 @@ class TestBincount(object):
"must not be negative",
lambda: np.bincount(x, minlength=-1))
- @dec.skipif(not HAS_REFCOUNT, "python has no sys.getrefcount")
+ @dec._needs_refcount
def test_dtype_reference_leaks(self):
# gh-6805
intp_refcount = sys.getrefcount(np.dtype(np.intp))