Skip to content

Commit b360d58

Browse files
committed
Add test for config warning in init_array
1 parent 4034997 commit b360d58

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_api.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
import zarr.codecs
99
import zarr.storage
10+
from zarr.core.array import init_array
11+
from zarr.storage._common import StorePath
1012

1113
if TYPE_CHECKING:
1214
import pathlib
@@ -390,6 +392,20 @@ def test_array_order(
390392
assert arr.metadata.order == expected_order
391393

392394

395+
async def test_init_order_warns() -> None:
396+
with pytest.warns(
397+
RuntimeWarning, match="The `order` keyword argument has no effect for Zarr format 3 arrays"
398+
):
399+
await init_array(
400+
store_path=StorePath(store=MemoryStore()),
401+
shape=(1,),
402+
dtype="uint8",
403+
config=None,
404+
zarr_format=3,
405+
order="F",
406+
)
407+
408+
393409
# def test_lazy_loader():
394410
# foo = np.arange(100)
395411
# bar = np.arange(100, 0, -1)

0 commit comments

Comments
 (0)