diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-08-15 14:22:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-15 14:22:20 -0500 |
commit | 63d30baee2535f03d55a10819ea1e56165d4c030 (patch) | |
tree | 9ec805147b5cbecdf8b4bc5e7a5264a3148ac532 /numpy/testing/utils.py | |
parent | 256103a9313a59a0a0762175574ed5acb5290520 (diff) | |
parent | 76eff9ca4648e96ba1f560e83f40383f68805493 (diff) | |
download | numpy-63d30baee2535f03d55a10819ea1e56165d4c030.tar.gz |
Merge pull request #7912 from mattip/pypy-fixes2
ENH: skip or avoid gc/objectmodel differences btwn pypy and cpython
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r-- | numpy/testing/utils.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index dc1115e1b..176d87800 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -32,7 +32,8 @@ __all__ = ['assert_equal', 'assert_almost_equal', 'assert_approx_equal', 'assert_', 'assert_array_almost_equal_nulp', 'assert_raises_regex', 'assert_array_max_ulp', 'assert_warns', 'assert_no_warnings', 'assert_allclose', 'IgnoreException', 'clear_and_catch_warnings', - 'SkipTest', 'KnownFailureException', 'temppath', 'tempdir'] + 'SkipTest', 'KnownFailureException', 'temppath', 'tempdir', 'IS_PYPY', + 'HAS_REFCOUNT'] class KnownFailureException(Exception): @@ -43,6 +44,8 @@ class KnownFailureException(Exception): KnownFailureTest = KnownFailureException # backwards compat verbose = 0 +IS_PYPY = '__pypy__' in sys.modules +HAS_REFCOUNT = getattr(sys, 'getrefcount', None) is not None def assert_(val, msg=''): """ @@ -1274,6 +1277,8 @@ def _assert_valid_refcount(op): Check that ufuncs don't mishandle refcount of object `1`. Used in a few regression tests. """ + if not HAS_REFCOUNT: + return True import numpy as np b = np.arange(100*100).reshape(100, 100) |