File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 66import pytest
77import sys
88
9+ from numcodecs .registry import get_codec
10+
911try :
1012 from zarr .codecs .registry import get_codec_class
1113 from zarr .array import Array
@@ -178,17 +180,16 @@ def test_generic_checksum(store: Store, codec_id: str):
178180
179181@pytest .mark .parametrize ("codec_id" , ["pcodec" , "zfpy" ])
180182def test_generic_bytes_codec (store : Store , codec_id : str ):
181- data = np .arange (0 , 256 , dtype = "float32" ).reshape ((16 , 16 ))
182-
183183 try :
184- codec_class = get_codec_class ( f"numcodecs. { codec_id } " )
184+ get_codec ({ "id" : codec_id })
185185 except ValueError as e :
186- # zfpy is not available on all platforms and versions
187186 if "codec not available" in str (e ):
188- return
187+ pytest . xfail ( f" { codec_id } is not available" )
189188 else :
190189 raise
191190
191+ data = np .arange (0 , 256 , dtype = "float32" ).reshape ((16 , 16 ))
192+
192193 with pytest .warns (UserWarning , match = "Numcodecs.*" ):
193194 a = Array .create (
194195 store / "generic" ,
@@ -197,7 +198,7 @@ def test_generic_bytes_codec(store: Store, codec_id: str):
197198 dtype = data .dtype ,
198199 fill_value = 0 ,
199200 codecs = [
200- codec_class ({"id" : codec_id }),
201+ get_codec_class ( f"numcodecs. { codec_id } " ) ({"id" : codec_id }),
201202 ],
202203 )
203204
You can’t perform that action at this time.
0 commit comments