Skip to content

Commit 79f4e31

Browse files
committed
update test to use to_json output
1 parent f4598c8 commit 79f4e31

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/test_array.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
_iter_shard_regions,
3939
_parse_chunk_encoding_v2,
4040
_parse_chunk_encoding_v3,
41+
_parse_codec,
4142
_shards_initialized,
4243
create_array,
4344
default_filters_v2,
@@ -1762,10 +1763,11 @@ def test_roundtrip_numcodecs() -> None:
17621763
with pytest.warns(ZarrUserWarning, match=warn_msg):
17631764
metadata = root["test"].metadata.to_dict()
17641765
# The names will change because numcodecs.<codec> is an alias for <codec>
1765-
expected = tuple(
1766-
{"name": v["name"].removeprefix("numcodecs."), "configuration": v["configuration"]} # type: ignore[index, attr-defined]
1767-
for v in (*filters, BYTES_CODEC, *compressors)
1768-
)
1766+
with pytest.warns(ZarrUserWarning, match=warn_msg):
1767+
expected = tuple(
1768+
_parse_codec(v, dtype=UInt8()).to_json(zarr_format=3) # type: ignore[index, attr-defined]
1769+
for v in (*filters, BYTES_CODEC, *compressors)
1770+
)
17691771
assert metadata["codecs"] == expected
17701772

17711773

0 commit comments

Comments
 (0)