11import tempfile
2+ from collections .abc import Callable , Coroutine
23from pathlib import Path
34
45import pytest
2223@pytest .mark .parametrize ("write_group" , [True , False ])
2324@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
2425async def test_contains_group (
25- local_store , path : str , write_group : bool , zarr_format : ZarrFormat
26+ local_store : LocalStore , path : str , write_group : bool , zarr_format : ZarrFormat
2627) -> None :
2728 """
2829 Test that the contains_group method correctly reports the existence of a group.
@@ -38,7 +39,7 @@ async def test_contains_group(
3839@pytest .mark .parametrize ("write_array" , [True , False ])
3940@pytest .mark .parametrize ("zarr_format" , [2 , 3 ])
4041async def test_contains_array (
41- local_store , path : str , write_array : bool , zarr_format : ZarrFormat
42+ local_store : LocalStore , path : str , write_array : bool , zarr_format : ZarrFormat
4243) -> None :
4344 """
4445 Test that the contains array method correctly reports the existence of an array.
@@ -51,13 +52,15 @@ async def test_contains_array(
5152
5253
5354@pytest .mark .parametrize ("func" , [contains_array , contains_group ])
54- async def test_contains_invalid_format_raises (local_store , func : callable ) -> None :
55+ async def test_contains_invalid_format_raises (
56+ local_store : LocalStore , func : Callable [[StorePath , ZarrFormat ], Coroutine [None , None , bool ]]
57+ ) -> None :
5558 """
5659 Test contains_group and contains_array raise errors for invalid zarr_formats
5760 """
5861 store_path = StorePath (local_store )
5962 with pytest .raises (ValueError ):
60- assert await func (store_path , zarr_format = "3.0" )
63+ assert await func (store_path , "3.0" ) # type: ignore[arg-type]
6164
6265
6366@pytest .mark .parametrize ("path" , [None , "" , "bar" ])
@@ -110,12 +113,12 @@ async def test_make_store_path_store_path(
110113
111114
112115@pytest .mark .parametrize ("modes" , [(True , "w" ), (False , "x" )])
113- async def test_store_path_invalid_mode_raises (tmpdir : LEGACY_PATH , modes : tuple ) -> None :
116+ async def test_store_path_invalid_mode_raises (tmpdir : LEGACY_PATH , modes : tuple [ bool , str ] ) -> None :
114117 """
115118 Test that ValueErrors are raise for invalid mode.
116119 """
117120 with pytest .raises (ValueError ):
118- await StorePath .open (LocalStore (str (tmpdir ), read_only = modes [0 ]), path = None , mode = modes [1 ])
121+ await StorePath .open (LocalStore (str (tmpdir ), read_only = modes [0 ]), path = "" , mode = modes [1 ]) # type: ignore[arg-type]
119122
120123
121124async def test_make_store_path_invalid () -> None :
@@ -126,7 +129,7 @@ async def test_make_store_path_invalid() -> None:
126129 await make_store_path (1 ) # type: ignore[arg-type]
127130
128131
129- async def test_make_store_path_fsspec (monkeypatch ) -> None :
132+ async def test_make_store_path_fsspec () -> None :
130133 pytest .importorskip ("fsspec" )
131134 pytest .importorskip ("requests" )
132135 pytest .importorskip ("aiohttp" )
@@ -175,12 +178,12 @@ def test_normalize_path_upath() -> None:
175178 assert normalize_path (upath .UPath ("foo/bar" )) == "foo/bar"
176179
177180
178- def test_normalize_path_none ():
181+ def test_normalize_path_none () -> None :
179182 assert normalize_path (None ) == ""
180183
181184
182185@pytest .mark .parametrize ("path" , ["." , ".." ])
183- def test_normalize_path_invalid (path : str ):
186+ def test_normalize_path_invalid (path : str ) -> None :
184187 with pytest .raises (ValueError ):
185188 normalize_path (path )
186189
@@ -221,7 +224,7 @@ def test_invalid(paths: tuple[str, str]) -> None:
221224 _normalize_paths (paths )
222225
223226
224- def test_normalize_path_keys ():
227+ def test_normalize_path_keys () -> None :
225228 """
226229 Test that ``_normalize_path_keys`` just applies the normalize_path function to each key of its
227230 input
0 commit comments