Skip to content

Commit 55f975c

Browse files
committed
test for codec with mandatory config
1 parent 6399f13 commit 55f975c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_array.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,26 @@ async def test_invalid_chunk_encoding(store: MemoryStore) -> None:
11941194
filters="nonexistent_filter_name",
11951195
)
11961196

1197+
# string representation of a codec is only supported if codec has no required arguments
1198+
msg = "Delta.__init__() missing 1 required positional argument: 'dtype'"
1199+
with pytest.raises(TypeError, match=re.escape(msg)):
1200+
await create_array(
1201+
store=store,
1202+
dtype="uint8",
1203+
shape=(10,),
1204+
zarr_format=2,
1205+
filters="delta",
1206+
)
1207+
msg = "TransposeCodec.__init__() missing 1 required keyword-only argument: 'order'"
1208+
with pytest.raises(TypeError, match=re.escape(msg)):
1209+
await create_array(
1210+
store=store,
1211+
dtype="uint8",
1212+
shape=(10,),
1213+
zarr_format=3,
1214+
filters="transpose",
1215+
)
1216+
11971217
@staticmethod
11981218
@pytest.mark.parametrize("dtype", ["uint8", "float32", "str"])
11991219
async def test_default_filters_compressors(

0 commit comments

Comments
 (0)