@@ -229,22 +229,23 @@ async def test_open_group_unspecified_version(
229
229
@pytest .mark .parametrize ("store" , ["local" , "memory" , "zip" ], indirect = ["store" ])
230
230
@pytest .mark .parametrize ("n_args" , [10 , 1 , 0 ])
231
231
@pytest .mark .parametrize ("n_kwargs" , [10 , 1 , 0 ])
232
- def test_save (store : Store , n_args : int , n_kwargs : int ) -> None :
232
+ @pytest .mark .parametrize ("path" , [None , "some_path" ])
233
+ def test_save (store : Store , n_args : int , n_kwargs : int , path : None | str ) -> None :
233
234
data = np .arange (10 )
234
235
args = [np .arange (10 ) for _ in range (n_args )]
235
236
kwargs = {f"arg_{ i } " : data for i in range (n_kwargs )}
236
237
237
238
if n_kwargs == 0 and n_args == 0 :
238
239
with pytest .raises (ValueError ):
239
- save (store )
240
+ save (store , path = path )
240
241
elif n_args == 1 and n_kwargs == 0 :
241
- save (store , * args )
242
- array = zarr .api .synchronous .open (store )
242
+ save (store , * args , path = path )
243
+ array = zarr .api .synchronous .open (store , path = path )
243
244
assert isinstance (array , Array )
244
245
assert_array_equal (array [:], data )
245
246
else :
246
- save (store , * args , ** kwargs ) # type: ignore [arg-type]
247
- group = zarr .api .synchronous .open (store )
247
+ save (store , * args , path = path , ** kwargs ) # type: ignore [arg-type]
248
+ group = zarr .api .synchronous .open (store , path = path )
248
249
assert isinstance (group , Group )
249
250
for array in group .array_values ():
250
251
assert_array_equal (array [:], data )
@@ -384,8 +385,8 @@ def test_array_order_warns(order: MemoryOrder | None, zarr_format: ZarrFormat) -
384
385
# assert "LazyLoader: " in repr(loader)
385
386
386
387
387
- def test_load_array (memory_store : Store ) -> None :
388
- store = memory_store
388
+ def test_load_array (sync_store : Store ) -> None :
389
+ store = sync_store
389
390
foo = np .arange (100 )
390
391
bar = np .arange (100 , 0 , - 1 )
391
392
save (store , foo = foo , bar = bar )
0 commit comments