diff options
author | Qiming Sun <osirpt.sun@gmail.com> | 2019-09-19 11:06:34 -0700 |
---|---|---|
committer | Qiming Sun <osirpt.sun@gmail.com> | 2019-09-19 11:06:34 -0700 |
commit | 89564795fa9683a1aa49e31f1e086812a1acd5fa (patch) | |
tree | 663bc2762640968b9f6ed5f76e48270a39f74c08 /numpy | |
parent | 001c43bb5f250ff7ad5d350046e4ef7ac6c202db (diff) | |
download | numpy-89564795fa9683a1aa49e31f1e086812a1acd5fa.tar.gz |
TEST: Fix broken pypy ctypes test
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 06a1a0a3d..cec6a6819 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -8006,6 +8006,11 @@ class TestCTypes(object): # but when the `ctypes_ptr` object dies, so should `arr` del ctypes_ptr + if IS_PYPY: + # Pypy does not recycle arr objects immediately. Trigger gc to + # release arr. Cpython uses refcounts. An explicit call to gc + # should not be needed here. + break_cycles() assert_(arr_ref() is None, "unknowable whether ctypes pointer holds a reference") def test_ctypes_as_parameter_holds_reference(self): @@ -8023,9 +8028,6 @@ class TestCTypes(object): # but when the `ctypes_ptr` object dies, so should `arr` del ctypes_ptr if IS_PYPY: - # Pypy does not recycle arr objects immediately. Trigger gc to - # release arr. Cpython uses refcounts. An explicit call to gc - # should not be needed here. break_cycles() assert_(arr_ref() is None, "unknowable whether ctypes pointer holds a reference") |