@@ -51,11 +51,11 @@ def test_create(memory_store: Store) -> None:
5151
5252 # create array with float shape
5353 with pytest .raises (TypeError ):
54- z = create (shape = (400.5 , 100 ), store = store , overwrite = True ) # type: ignore [arg-type]
54+ z = create (shape = (400.5 , 100 ), store = store , overwrite = True )
5555
5656 # create array with float chunk shape
5757 with pytest .raises (TypeError ):
58- z = create (shape = (400 , 100 ), chunks = (16 , 16.5 ), store = store , overwrite = True ) # type: ignore [arg-type]
58+ z = create (shape = (400 , 100 ), chunks = (16 , 16.5 ), store = store , overwrite = True )
5959
6060
6161# TODO: parametrize over everything this function takes
@@ -200,7 +200,7 @@ def test_save(store: Store, n_args: int, n_kwargs: int) -> None:
200200 assert isinstance (array , Array )
201201 assert_array_equal (array [:], data )
202202 else :
203- save (store , * args , ** kwargs ) # type: ignore[arg-type]
203+ save (store , * args , ** kwargs )
204204 group = open (store )
205205 assert isinstance (group , Group )
206206 for array in group .array_values ():
@@ -1086,10 +1086,16 @@ async def test_open_falls_back_to_open_group_async() -> None:
10861086 assert group .attrs == {"key" : "value" }
10871087
10881088
1089- def test_open_mode_write_creates_group (tmp_path : pathlib .Path ) -> None :
1089+ @pytest .mark .parametrize ("mode" , ["r" , "r+" , "w" , "a" ])
1090+ def test_open_modes_creates_group (tmp_path : pathlib .Path , mode : str ) -> None :
10901091 # https://github.com/zarr-developers/zarr-python/issues/2490
1091- zarr_dir = tmp_path / "test.zarr"
1092- group = zarr .open (zarr_dir , mode = "w" )
1092+ zarr_dir = tmp_path / f"mode-{ mode } -test.zarr"
1093+ if mode in ["r" , "r+" ]:
1094+ # Expect FileNotFoundError to be raised if 'r' or 'r+' mode
1095+ with pytest .raises (FileNotFoundError ):
1096+ zarr .open (store = zarr_dir , mode = mode )
1097+ zarr .open (store = zarr_dir , mode = "w" )
1098+ group = zarr .open (store = zarr_dir , mode = mode )
10931099 assert isinstance (group , Group )
10941100
10951101
@@ -1098,13 +1104,13 @@ async def test_metadata_validation_error() -> None:
10981104 MetadataValidationError ,
10991105 match = "Invalid value for 'zarr_format'. Expected '2, 3, or None'. Got '3.0'." ,
11001106 ):
1101- await zarr .api .asynchronous .open_group (zarr_format = "3.0" ) # type: ignore[arg-type]
1107+ await zarr .api .asynchronous .open_group (zarr_format = "3.0" )
11021108
11031109 with pytest .raises (
11041110 MetadataValidationError ,
11051111 match = "Invalid value for 'zarr_format'. Expected '2, 3, or None'. Got '3.0'." ,
11061112 ):
1107- await zarr .api .asynchronous .open_array (shape = (1 ,), zarr_format = "3.0" ) # type: ignore[arg-type]
1113+ await zarr .api .asynchronous .open_array (shape = (1 ,), zarr_format = "3.0" )
11081114
11091115
11101116@pytest .mark .parametrize (
0 commit comments