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,19 @@ 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 ,
1325+ create_function : Callable , # type:ignore[type-arg]
1326+ overwrite : bool ,
1327+ ) -> None :
13291328 store = zarr .storage .LocalStore (tmp_path )
13301329 existing_fpath = add_empty_file (tmp_path )
13311330
@@ -1339,7 +1338,11 @@ def test_no_overwrite_array(tmp_path: Path, create_function: Callable, overwrite
13391338
13401339@pytest .mark .parametrize ("create_function" , [create_group , group ])
13411340@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]
1341+ def test_no_overwrite_group (
1342+ tmp_path : pathlib .Path ,
1343+ create_function : Callable , # type:ignore[type-arg]
1344+ overwrite : bool ,
1345+ ) -> None :
13431346 store = zarr .storage .LocalStore (tmp_path )
13441347 existing_fpath = add_empty_file (tmp_path )
13451348
@@ -1353,7 +1356,7 @@ def test_no_overwrite_group(tmp_path: Path, create_function: Callable, overwrite
13531356
13541357@pytest .mark .parametrize ("open_func" , [zarr .open , open_group ])
13551358@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]
1359+ def test_no_overwrite_open (tmp_path : pathlib . Path , open_func : Callable , mode : str ) -> None : # type:ignore[type-arg]
13571360 store = zarr .storage .LocalStore (tmp_path )
13581361 existing_fpath = add_empty_file (tmp_path )
13591362
@@ -1366,7 +1369,7 @@ def test_no_overwrite_open(tmp_path: Path, open_func: Callable, mode: str) -> No
13661369 assert existing_fpath .exists ()
13671370
13681371
1369- def test_no_overwrite_load (tmp_path : Path ) -> None :
1372+ def test_no_overwrite_load (tmp_path : pathlib . Path ) -> None :
13701373 store = zarr .storage .LocalStore (tmp_path )
13711374 existing_fpath = add_empty_file (tmp_path )
13721375
0 commit comments