Skip to content

Commit 1f827ca

Browse files
committed
fix: test
1 parent 34da14f commit 1f827ca

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

tests/test_array.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pickle
77
import re
88
import sys
9+
from contextlib import nullcontext
910
from itertools import accumulate, starmap
1011
from typing import TYPE_CHECKING, Any, Literal
1112
from unittest import mock
@@ -1073,13 +1074,21 @@ def test_auto_partition_auto_shards(
10731074
where there are 8 or more chunks.
10741075
"""
10751076
dtype = np.dtype("uint8")
1076-
with zarr.config.set({"array.target_shard_size_bytes": target_shard_size_bytes}):
1077-
auto_shards, _ = _auto_partition(
1078-
array_shape=array_shape,
1079-
chunk_shape=chunk_shape,
1080-
shard_shape="auto",
1081-
item_size=dtype.itemsize,
1077+
with (
1078+
pytest.warns(
1079+
ZarrUserWarning,
1080+
match="Automatic shard shape inference is experimental and may change without notice.",
10821081
)
1082+
if target_shard_size_bytes is None
1083+
else nullcontext()
1084+
):
1085+
with zarr.config.set({"array.target_shard_size_bytes": target_shard_size_bytes}):
1086+
auto_shards, _ = _auto_partition(
1087+
array_shape=array_shape,
1088+
chunk_shape=chunk_shape,
1089+
shard_shape="auto",
1090+
item_size=dtype.itemsize,
1091+
)
10831092
assert auto_shards == expected_shards
10841093

10851094

0 commit comments

Comments
 (0)