25
25
if TYPE_CHECKING :
26
26
from collections .abc import Iterator
27
27
28
- from zarr .abc .store import Store
29
28
from zarr .core .common import ChunkCoords
30
29
31
30
32
31
@pytest .fixture
33
- async def store () -> Iterator [Store ]:
32
+ async def store () -> Iterator [StorePath ]:
34
33
yield StorePath (await MemoryStore .open (mode = "w" ))
35
34
36
35
@@ -52,7 +51,7 @@ def zarr_array_from_numpy_array(
52
51
53
52
class CountingDict (MemoryStore ):
54
53
@classmethod
55
- async def open (cls ):
54
+ async def open (cls ) -> CountingDict :
56
55
store = await super ().open (mode = "w" )
57
56
store .counter = Counter ()
58
57
return store
@@ -68,7 +67,7 @@ async def set(self, key, value, byte_range=None):
68
67
return await super ().set (key , value , byte_range )
69
68
70
69
71
- def test_normalize_integer_selection ():
70
+ def test_normalize_integer_selection () -> None :
72
71
assert 1 == normalize_integer_selection (1 , 100 )
73
72
assert 99 == normalize_integer_selection (- 1 , 100 )
74
73
with pytest .raises (IndexError ):
@@ -79,7 +78,7 @@ def test_normalize_integer_selection():
79
78
normalize_integer_selection (- 1000 , 100 )
80
79
81
80
82
- def test_replace_ellipsis ():
81
+ def test_replace_ellipsis () -> None :
83
82
# 1D, single item
84
83
assert (0 ,) == replace_ellipsis (0 , (100 ,))
85
84
@@ -258,7 +257,7 @@ def _test_get_basic_selection(a, z, selection):
258
257
259
258
260
259
# noinspection PyStatementEffect
261
- def test_get_basic_selection_1d (store : StorePath ):
260
+ def test_get_basic_selection_1d (store : StorePath ) -> None :
262
261
# setup
263
262
a = np .arange (1050 , dtype = int )
264
263
z = zarr_array_from_numpy_array (store , a , chunk_shape = (100 ,))
@@ -328,7 +327,7 @@ def test_get_basic_selection_1d(store: StorePath):
328
327
329
328
330
329
# noinspection PyStatementEffect
331
- def test_get_basic_selection_2d (store : StorePath ):
330
+ def test_get_basic_selection_2d (store : StorePath ) -> None :
332
331
# setup
333
332
a = np .arange (10000 , dtype = int ).reshape (1000 , 10 )
334
333
z = zarr_array_from_numpy_array (store , a , chunk_shape = (300 , 3 ))
@@ -349,7 +348,7 @@ def test_get_basic_selection_2d(store: StorePath):
349
348
np .testing .assert_array_equal (z [fancy_selection ], [0 , 11 ])
350
349
351
350
352
- def test_fancy_indexing_fallback_on_get_setitem (store : StorePath ):
351
+ def test_fancy_indexing_fallback_on_get_setitem (store : StorePath ) -> None :
353
352
z = zarr_array_from_numpy_array (store , np .zeros ((20 , 20 )))
354
353
z [[1 , 2 , 3 ], [1 , 2 , 3 ]] = 1
355
354
np .testing .assert_array_equal (
0 commit comments