@@ -1342,7 +1342,7 @@ async def test_invalid_chunk_encoding(store: MemoryStore) -> None:
1342
1342
],
1343
1343
)
1344
1344
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
1346
1346
) -> None :
1347
1347
"""
1348
1348
Test that passing an invalid codec to create_array raises an error.
@@ -1369,12 +1369,13 @@ async def test_chunk_encoding_wrong_type(
1369
1369
("compressors" , "mock_compressor_v3" , "MockCompressorRequiresConfig3" , 3 ),
1370
1370
("compressors" , ("mock_compressor_v3" ,), "MockCompressorRequiresConfig3" , 3 ),
1371
1371
("compressors" , "mock_compressor_v2" , "MockCompressorRequiresConfig2" , 2 ),
1372
+ ("compressors" , ("mock_compressor_v2" ,), "MockCompressorRequiresConfig2" , 2 ),
1372
1373
],
1373
1374
)
1374
1375
async def test_chunk_encoding_missing_arguments (
1375
1376
store : MemoryStore ,
1376
1377
argument_key : str ,
1377
- codec : str ,
1378
+ codec : str | tuple [ FiltersLike | SerializerLike | CompressorsLike ] ,
1378
1379
codec_cls_name : str ,
1379
1380
zarr_format : ZarrFormat ,
1380
1381
) -> None :
@@ -1385,7 +1386,7 @@ async def test_chunk_encoding_missing_arguments(
1385
1386
f"cannot be specified by a string because it takes a required configuration. Use either the dict "
1386
1387
f"representation of { codec_key } codec, or pass in a concrete { codec_cls_name } instance instead"
1387
1388
)
1388
- if codec == "mock_compressor_v3" :
1389
+ if "mock_compressor_v3" in codec :
1389
1390
1390
1391
class MockCompressorRequiresConfig3 (BytesBytesCodec ):
1391
1392
def compute_encoded_size (
@@ -1397,16 +1398,16 @@ def __init__(self, *, argument: str) -> None:
1397
1398
super ().__init__ ()
1398
1399
1399
1400
register_codec ("mock_compressor_v3" , MockCompressorRequiresConfig3 )
1400
- elif codec == "mock_compressor_v2" :
1401
+ elif "mock_compressor_v2" in codec :
1401
1402
1402
1403
class MockCompressorRequiresConfig2 (numcodecs .abc .Codec ):
1403
1404
def __init__ (self , * , argument : str ) -> None :
1404
1405
super ().__init__ ()
1405
1406
1406
- def encode (self : Any , buf ) -> Any :
1407
+ def encode (self : Any , buf ) -> Any : # type: ignore[no-untyped-def]
1407
1408
pass
1408
1409
1409
- def decode (self , buf : Any , out = None ) -> Any :
1410
+ def decode (self , buf : Any , out = None ) -> Any : # type: ignore[no-untyped-def]
1410
1411
pass
1411
1412
1412
1413
numcodecs .register_codec (
0 commit comments