Skip to content

Commit c81be37

Browse files
committed
Add compressors
This is important for zarr-developers#1931
1 parent 10badfb commit c81be37

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎tests/test_properties.py‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
shape=npst.array_shapes(max_dims=4),
3737
)
3838
stores = st.builds(MemoryStore, st.just({}), mode=st.just("w"))
39+
compressors = st.sampled_from([None, "default"])
3940

4041

4142
@st.composite
@@ -54,12 +55,21 @@ def np_array_and_chunks(draw, *, arrays=np_arrays):
5455

5556

5657
@st.composite
57-
def arrays(draw, *, stores=stores, arrays=np_arrays, paths=paths, array_names=array_names):
58+
def arrays(
59+
draw,
60+
*,
61+
compressors=compressors,
62+
stores=stores,
63+
arrays=np_arrays,
64+
paths=paths,
65+
array_names=array_names,
66+
):
5867
store = draw(stores)
5968
nparray, chunks = draw(np_array_and_chunks(arrays=arrays))
6069
path = draw(paths)
6170
name = draw(array_names)
6271
attributes = draw(attrs)
72+
compressor = draw(compressors)
6373

6474
# TODO: clean this up
6575
if path is None and name is None:
@@ -89,6 +99,7 @@ def arrays(draw, *, stores=stores, arrays=np_arrays, paths=paths, array_names=ar
8999
chunks=chunks,
90100
dtype=nparray.dtype.str,
91101
attributes=attributes,
102+
compressor=compressor,
92103
# TODO: FIXME seems to break with booleans and timedelta
93104
# fill_value=nparray.dtype.type(0),
94105
)
@@ -122,6 +133,7 @@ def test_roundtrip(data):
122133

123134

124135
# @pytest.mark.slow
136+
@settings(max_examples=500)
125137
@given(data=st.data())
126138
def test_basic_indexing(data):
127139
def is_negative_slice(idx):

0 commit comments

Comments
 (0)