Skip to content

Commit 6285739

Browse files
committed
additional check in test_explicit_endianness
1 parent a276c84 commit 6285739

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_array.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,3 +1426,19 @@ def test_explicit_endianness(store: Store, endianness: Endianness) -> None:
14261426
zarr_format=3,
14271427
serializer=serializer,
14281428
)
1429+
1430+
# additional check for the case where the serializer has endian=None
1431+
none_serializer = dataclasses.replace(serializer, endian=None)
1432+
msg = (
1433+
f"The endianness of the requested serializer ({none_serializer}) does not match the endianness of the dtype ({dtype.endianness}). "
1434+
"The endianness of the serializer and the dtype must match."
1435+
)
1436+
1437+
with pytest.raises(ValueError, match=re.escape(msg)):
1438+
_ = zarr.create_array(
1439+
store=store,
1440+
shape=(1,),
1441+
dtype=dtype,
1442+
zarr_format=3,
1443+
serializer=none_serializer,
1444+
)

0 commit comments

Comments
 (0)