diff options
author | kngwyu <yuji.kngw.80s.revive@gmail.com> | 2018-10-18 14:34:51 +0900 |
---|---|---|
committer | kngwyu <yuji.kngw.80s.revive@gmail.com> | 2018-10-18 14:34:51 +0900 |
commit | b2b32aaa2a8984ab52dfb2161e4bb9ed83c4aaff (patch) | |
tree | fc2ed32e9f77a7c23eb6a12ceb4b23c8d3e0adcf /numpy/core | |
parent | 7131b696d10f143f9755ce6f7b5d5c03ecbc7459 (diff) | |
download | numpy-b2b32aaa2a8984ab52dfb2161e4bb9ed83c4aaff.tar.gz |
MAINT: add a test for weakref checking when resizing
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 36d148f55..21637f059 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -4730,6 +4730,12 @@ class TestResize(object): x_view.resize((0, 10)) x_view.resize((0, 100)) + def test_check_weakref(self): + x = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) + xref = weakref.ref(x) + assert_raises(ValueError, x.resize, (5, 1)) + del xref # avoid pyflakes unused variable warning. + class TestRecord(object): def test_field_rename(self): |