Skip to content

Commit 8bb72d6

Browse files
authored
Merge pull request #483 from Blosc/fix-view
Extend test slightly
2 parents 095b809 + 8db7468 commit 8bb72d6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/ndarray/test_resize.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,14 @@ def test_expand_dims(shape, axis, chunks, blocks, fill_value):
7575
del view
7676
del bloscview
7777
assert sys.getrefcount(arr) == sys.getrefcount(bloscarr_) == 2
78+
79+
# view of a view
80+
view = np.expand_dims(arr, 0)
81+
bloscview = blosc2.expand_dims(bloscarr_, 0)
82+
view2 = np.expand_dims(view, 0)
83+
bloscview2 = blosc2.expand_dims(bloscview, 0)
84+
assert sys.getrefcount(arr) == sys.getrefcount(bloscarr_) == 4
85+
86+
del bloscview
87+
del bloscarr_
88+
assert bloscview2[()].shape == bloscview2.shape # shouldn't fail because still have access to bloscarr_

0 commit comments

Comments
 (0)