@@ -1335,7 +1335,7 @@ async def test_scalar_array() -> None:
13351335@pytest .mark .parametrize ("store" , ["local" ], indirect = True )
13361336@pytest .mark .parametrize ("store2" , ["local" ], indirect = ["store2" ])
13371337@pytest .mark .parametrize ("src_format" , [2 , 3 ])
1338- @pytest .mark .parametrize ("new_format" , [2 , 3 ])
1338+ @pytest .mark .parametrize ("new_format" , [2 , 3 , None ])
13391339async def test_creation_from_other_zarr_format (
13401340 store : Store ,
13411341 store2 : Store ,
@@ -1365,10 +1365,19 @@ async def test_creation_from_other_zarr_format(
13651365 assert result .fill_value == src .fill_value
13661366 assert result .dtype == src .dtype
13671367 assert result .chunks == src .chunks
1368- assert result .metadata .zarr_format == new_format
1368+ expected_format = src_format if new_format is None else new_format
1369+ assert result .metadata .zarr_format == expected_format
13691370 if src_format == new_format :
13701371 assert result .metadata == src .metadata
13711372
1373+ result2 = zarr .array (
1374+ data = src ,
1375+ store = store2 ,
1376+ overwrite = True ,
1377+ zarr_format = new_format ,
1378+ )
1379+ np .testing .assert_array_equal (result2 [:], src [:])
1380+
13721381
13731382@pytest .mark .parametrize ("store" , ["local" , "memory" , "zip" ], indirect = True )
13741383@pytest .mark .parametrize ("store2" , ["local" , "memory" , "zip" ], indirect = ["store2" ])
0 commit comments