Skip to content

Commit 9e35f7c

Browse files
committed
typing
1 parent 41000fd commit 9e35f7c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/test_array.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ async def test_invalid_chunk_encoding(store: MemoryStore) -> None:
13421342
],
13431343
)
13441344
async def test_chunk_encoding_wrong_type(
1345-
argument_key: str, codec: str, store: MemoryStore
1345+
argument_key: str, codec: FiltersLike | SerializerLike | CompressorsLike, store: MemoryStore
13461346
) -> None:
13471347
"""
13481348
Test that passing an invalid codec to create_array raises an error.
@@ -1369,12 +1369,13 @@ async def test_chunk_encoding_wrong_type(
13691369
("compressors", "mock_compressor_v3", "MockCompressorRequiresConfig3", 3),
13701370
("compressors", ("mock_compressor_v3",), "MockCompressorRequiresConfig3", 3),
13711371
("compressors", "mock_compressor_v2", "MockCompressorRequiresConfig2", 2),
1372+
("compressors", ("mock_compressor_v2",), "MockCompressorRequiresConfig2", 2),
13721373
],
13731374
)
13741375
async def test_chunk_encoding_missing_arguments(
13751376
store: MemoryStore,
13761377
argument_key: str,
1377-
codec: str,
1378+
codec: str | tuple[FiltersLike | SerializerLike | CompressorsLike],
13781379
codec_cls_name: str,
13791380
zarr_format: ZarrFormat,
13801381
) -> None:
@@ -1385,7 +1386,7 @@ async def test_chunk_encoding_missing_arguments(
13851386
f"cannot be specified by a string because it takes a required configuration. Use either the dict "
13861387
f"representation of {codec_key} codec, or pass in a concrete {codec_cls_name} instance instead"
13871388
)
1388-
if codec == "mock_compressor_v3":
1389+
if "mock_compressor_v3" in codec:
13891390

13901391
class MockCompressorRequiresConfig3(BytesBytesCodec):
13911392
def compute_encoded_size(
@@ -1397,16 +1398,16 @@ def __init__(self, *, argument: str) -> None:
13971398
super().__init__()
13981399

13991400
register_codec("mock_compressor_v3", MockCompressorRequiresConfig3)
1400-
elif codec == "mock_compressor_v2":
1401+
elif "mock_compressor_v2" in codec:
14011402

14021403
class MockCompressorRequiresConfig2(numcodecs.abc.Codec):
14031404
def __init__(self, *, argument: str) -> None:
14041405
super().__init__()
14051406

1406-
def encode(self: Any, buf) -> Any:
1407+
def encode(self: Any, buf) -> Any: # type: ignore[no-untyped-def]
14071408
pass
14081409

1409-
def decode(self, buf: Any, out=None) -> Any:
1410+
def decode(self, buf: Any, out=None) -> Any: # type: ignore[no-untyped-def]
14101411
pass
14111412

14121413
numcodecs.register_codec(

0 commit comments

Comments
 (0)