Skip to content

Commit d525d7f

Browse files
committed
fix list unpacking in test for python3.10
1 parent 31c1e7a commit d525d7f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/v3/test_indexing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ def test_get_basic_selection_0d(store: StorePath):
191191
slice(50, 150, 10),
192192
]
193193

194-
195194
basic_selections_1d_bad = [
196195
# only positive step supported
197196
slice(None, None, -1),
@@ -292,7 +291,6 @@ def test_get_basic_selection_1d(store: StorePath):
292291
(Ellipsis, slice(None), slice(None)),
293292
]
294293

295-
296294
basic_selections_2d_bad = [
297295
# bad stuff
298296
2.3,
@@ -1749,8 +1747,9 @@ def test_accessed_chunks(shape, chunks, ops):
17491747
def test_indexing_equals_numpy(store, selection):
17501748
a = np.arange(10000, dtype=int).reshape(1000, 10)
17511749
z = zarr_array_from_numpy_array(store, a, chunk_shape=(300, 3))
1752-
expected = a[*selection]
1753-
actual = z[*selection]
1750+
# note: in python 3.10 a[*selection] is no valid unpacking syntax
1751+
expected = a[(*selection,)]
1752+
actual = z[(*selection,)]
17541753
assert_array_equal(expected, actual, err_msg=f"selection: {selection}")
17551754

17561755

@@ -1767,5 +1766,6 @@ def test_orthogonal_bool_indexing_like_numpy_ix(store, selection):
17671766
a = np.arange(10000, dtype=int).reshape(1000, 10)
17681767
z = zarr_array_from_numpy_array(store, a, chunk_shape=(300, 3))
17691768
expected = a[np.ix_(*selection)]
1770-
actual = z[*selection]
1769+
# note: in python 3.10 z[*selection] is no valid unpacking syntax
1770+
actual = z[(*selection,)]
17711771
assert_array_equal(expected, actual, err_msg=f"{selection=}")

0 commit comments

Comments
 (0)