Skip to content

Commit 70d1bac

Browse files
committed
Fix array test
1 parent fc154a8 commit 70d1bac

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

tests/test_array.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pickle
66
import re
77
import sys
8+
from contextlib import nullcontext
89
from itertools import accumulate
910
from typing import TYPE_CHECKING, Any, Literal
1011
from unittest import mock
@@ -1419,14 +1420,23 @@ def test_order(
14191420
# Test without passing config parameter
14201421
config = None
14211422

1422-
arr = zarr.create_array(
1423-
store=store,
1424-
shape=(2, 2),
1425-
zarr_format=zarr_format,
1426-
dtype="i4",
1427-
order=order,
1428-
config=config,
1429-
)
1423+
if zarr_format == 3 and order is not None:
1424+
ctx = pytest.warns(
1425+
RuntimeWarning,
1426+
match="The `order` keyword argument has no effect for Zarr format 3 arrays",
1427+
)
1428+
else:
1429+
ctx = nullcontext()
1430+
1431+
with ctx:
1432+
arr = zarr.create_array(
1433+
store=store,
1434+
shape=(2, 2),
1435+
zarr_format=zarr_format,
1436+
dtype="i4",
1437+
order=order,
1438+
config=config,
1439+
)
14301440
assert arr.order == expected
14311441
if zarr_format == 2:
14321442
assert arr.metadata.zarr_format == 2

0 commit comments

Comments
 (0)