Skip to content

Commit 7a9d10d

Browse files
committed
Add xfails
1 parent 75114ae commit 7a9d10d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/test_indexing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ def test_orthogonal_indexing_fallback_on_getitem_2d(
424424
np.testing.assert_array_equal(z[index], expected_result)
425425

426426

427+
@pytest.mark.xfail(reason="fails on ubuntu, windows; numpy=2.2; in CI")
427428
def test_setitem_repeated_index():
428429
array = zarr.array(data=np.zeros((4,)), chunks=(1,))
429430
indexer = np.array([-1, -1, 0, 0])

tests/test_properties.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import numpy as np
12
import pytest
23
from numpy.testing import assert_array_equal
34

@@ -7,7 +8,7 @@
78

89
import hypothesis.extra.numpy as npst
910
import hypothesis.strategies as st
10-
from hypothesis import assume, given, note, reproduce_failure
11+
from hypothesis import assume, given, note
1112

1213
from zarr.abc.store import Store
1314
from zarr.core.metadata import ArrayV2Metadata, ArrayV3Metadata
@@ -75,6 +76,10 @@ def test_oindex(data: st.DataObject) -> None:
7576
assert_array_equal(nparray[npindexer], actual)
7677

7778
assume(zarray.shards is None) # GH2834
79+
for idxr in npindexer:
80+
if isinstance(idxr, np.ndarray) and idxr.size != np.unique(idxr).size:
81+
# behaviour of setitem with repeated indices is not guaranteed in practice
82+
assume(False)
7883
new_data = data.draw(npst.arrays(shape=st.just(actual.shape), dtype=nparray.dtype))
7984
nparray[npindexer] = new_data
8085
zarray.oindex[zindexer] = new_data

0 commit comments

Comments
 (0)