11from __future__ import annotations
22
33import inspect
4- import pathlib
54import re
65from typing import TYPE_CHECKING
76
4645from zarr .storage ._utils import normalize_path
4746from zarr .testing .utils import gpu_test
4847
49- if TYPE_CHECKING :
50- from collections .abc import Callable
51- from pathlib import Path
52-
5348
5449def test_create (memory_store : Store ) -> None :
5550 store = memory_store
@@ -1317,15 +1312,17 @@ def test_v2_with_v3_compressor() -> None:
13171312 )
13181313
13191314
1320- def add_empty_file (path : Path ) -> Path :
1315+ def add_empty_file (path : pathlib . Path ) -> pathlib . Path :
13211316 fpath = path / "a.txt"
13221317 fpath .touch ()
13231318 return fpath
13241319
13251320
13261321@pytest .mark .parametrize ("create_function" , [create_array , from_array ])
13271322@pytest .mark .parametrize ("overwrite" , [True , False ])
1328- def test_no_overwrite_array (tmp_path : Path , create_function : Callable , overwrite : bool ) -> None : # type:ignore[type-arg]
1323+ def test_no_overwrite_array (
1324+ tmp_path : pathlib .Path , create_function : Callable , overwrite : bool # type:ignore[type-arg]
1325+ ) -> None :
13291326 store = zarr .storage .LocalStore (tmp_path )
13301327 existing_fpath = add_empty_file (tmp_path )
13311328
@@ -1339,7 +1336,9 @@ def test_no_overwrite_array(tmp_path: Path, create_function: Callable, overwrite
13391336
13401337@pytest .mark .parametrize ("create_function" , [create_group , group ])
13411338@pytest .mark .parametrize ("overwrite" , [True , False ])
1342- def test_no_overwrite_group (tmp_path : Path , create_function : Callable , overwrite : bool ) -> None : # type:ignore[type-arg]
1339+ def test_no_overwrite_group (
1340+ tmp_path : pathlib .Path , create_function : Callable , overwrite : bool # type:ignore[type-arg]
1341+ ) -> None :
13431342 store = zarr .storage .LocalStore (tmp_path )
13441343 existing_fpath = add_empty_file (tmp_path )
13451344
@@ -1353,7 +1352,7 @@ def test_no_overwrite_group(tmp_path: Path, create_function: Callable, overwrite
13531352
13541353@pytest .mark .parametrize ("open_func" , [zarr .open , open_group ])
13551354@pytest .mark .parametrize ("mode" , ["r" , "r+" , "a" , "w" , "w-" ])
1356- def test_no_overwrite_open (tmp_path : Path , open_func : Callable , mode : str ) -> None : # type:ignore[type-arg]
1355+ def test_no_overwrite_open (tmp_path : pathlib . Path , open_func : Callable , mode : str ) -> None : # type:ignore[type-arg]
13571356 store = zarr .storage .LocalStore (tmp_path )
13581357 existing_fpath = add_empty_file (tmp_path )
13591358
@@ -1366,7 +1365,7 @@ def test_no_overwrite_open(tmp_path: Path, open_func: Callable, mode: str) -> No
13661365 assert existing_fpath .exists ()
13671366
13681367
1369- def test_no_overwrite_load (tmp_path : Path ) -> None :
1368+ def test_no_overwrite_load (tmp_path : pathlib . Path ) -> None :
13701369 store = zarr .storage .LocalStore (tmp_path )
13711370 existing_fpath = add_empty_file (tmp_path )
13721371
0 commit comments