Skip to content

Commit e5529a3

Browse files
committed
format
1 parent 6998375 commit e5529a3

1 file changed

Lines changed: 30 additions & 10 deletions

File tree

tests/test_array.py

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,13 +1182,23 @@ async def test_create_array_invalid_v2_arguments(
11821182
await zarr.api.asynchronous.create_array(
11831183
store=store, dtype="uint8", shape=(10,), chunks=(1,), zarr_format=2, **kwargs
11841184
)
1185+
11851186
@staticmethod
11861187
@pytest.mark.parametrize(
11871188
("kwargs", "error_msg"),
11881189
[
1189-
({"dimension_names": ["test"]}, "dimension_names cannot be used for arrays with zarr_format 2."),
1190-
({"chunk_key_encoding": {"name": "default", "separator": "/"}}, "chunk_key_encoding cannot be used for arrays with zarr_format 2. Use dimension_separator instead."),
1191-
({"codecs": "bytes"}, "codecs cannot be used for arrays with zarr_format 2. Use filters and compressor instead."),
1190+
(
1191+
{"dimension_names": ["test"]},
1192+
"dimension_names cannot be used for arrays with zarr_format 2.",
1193+
),
1194+
(
1195+
{"chunk_key_encoding": {"name": "default", "separator": "/"}},
1196+
"chunk_key_encoding cannot be used for arrays with zarr_format 2. Use dimension_separator instead.",
1197+
),
1198+
(
1199+
{"codecs": "bytes"},
1200+
"codecs cannot be used for arrays with zarr_format 2. Use filters and compressor instead.",
1201+
),
11921202
],
11931203
)
11941204
async def test_create_invalid_v2_arguments(
@@ -1203,20 +1213,30 @@ async def test_create_invalid_v2_arguments(
12031213
@pytest.mark.parametrize(
12041214
("kwargs", "error_msg"),
12051215
[
1206-
({"chunk_shape": (1,), "chunks": (2,)}, "Only one of chunk_shape or chunks can be provided."),
1207-
({"dimension_separator": "/"}, "dimension_separator cannot be used for arrays with zarr_format 3. Use chunk_key_encoding instead."),
1208-
({"filters": []}, "filters cannot be used for arrays with zarr_format 3. Use array-to-array codecs instead"),
1209-
({"compressor": "blosc"}, "compressor cannot be used for arrays with zarr_format 3. Use bytes-to-bytes codecs instead"),
1216+
(
1217+
{"chunk_shape": (1,), "chunks": (2,)},
1218+
"Only one of chunk_shape or chunks can be provided.",
1219+
),
1220+
(
1221+
{"dimension_separator": "/"},
1222+
"dimension_separator cannot be used for arrays with zarr_format 3. Use chunk_key_encoding instead.",
1223+
),
1224+
(
1225+
{"filters": []},
1226+
"filters cannot be used for arrays with zarr_format 3. Use array-to-array codecs instead",
1227+
),
1228+
(
1229+
{"compressor": "blosc"},
1230+
"compressor cannot be used for arrays with zarr_format 3. Use bytes-to-bytes codecs instead",
1231+
),
12101232
],
12111233
)
12121234
async def test_invalid_v3_arguments(
12131235
kwargs: dict[str, Any], error_msg: str, store: MemoryStore
12141236
) -> None:
12151237
kwargs.setdefault("chunks", (1,))
12161238
with pytest.raises(ValueError, match=re.escape(error_msg)):
1217-
zarr.create(
1218-
store=store, dtype="uint8", shape=(10,), zarr_format=3, **kwargs
1219-
)
1239+
zarr.create(store=store, dtype="uint8", shape=(10,), zarr_format=3, **kwargs)
12201240

12211241
@staticmethod
12221242
@pytest.mark.parametrize("dtype", ["uint8", "float32", "str"])

0 commit comments

Comments
 (0)