Skip to content

Commit 39fb5e0

Browse files
committed
parametrize over array type
1 parent 85d14d1 commit 39fb5e0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/test_array.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,10 @@ def test_iter_chunk_regions(
21232123

21242124

21252125
@pytest.mark.parametrize("num_shards", [1, 3])
2126-
def test_create_array_with_data_num_gets(num_shards: int) -> None:
2126+
@pytest.mark.parametrize("array_type", ["numpy", "zarr"])
2127+
def test_create_array_with_data_num_gets(
2128+
num_shards: int, array_type: Literal["numpy", "zarr"]
2129+
) -> None:
21272130
"""
21282131
Test that creating an array with data only invokes a single get request per stored object
21292132
"""
@@ -2132,7 +2135,10 @@ def test_create_array_with_data_num_gets(num_shards: int) -> None:
21322135
chunk_shape = (1,)
21332136
shard_shape = (100,)
21342137
shape = (shard_shape[0] * num_shards,)
2135-
data = np.arange(shape[0])
2138+
if array_type == "numpy":
2139+
data = np.arange(shape[0])
2140+
else:
2141+
data = zarr.zeros(shape, dtype="int64")
21362142

21372143
zarr.create_array(store, data=data, chunks=chunk_shape, shards=shard_shape, fill_value=-1)
21382144
# one get for the metadata and one per shard.

0 commit comments

Comments
 (0)