6
6
7
7
from zarr .abc .store import ByteRequest , Store
8
8
from zarr .core .buffer import Buffer
9
+ from zarr .core .buffer .cpu import Buffer as CPUBuffer
9
10
from zarr .core .buffer .cpu import buffer_prototype
10
11
from zarr .storage import LocalStore , WrapperStore
11
12
from zarr .testing .store import StoreTests
@@ -29,9 +30,9 @@ class OpenKwargs(TypedDict):
29
30
@pytest .mark .filterwarnings (
30
31
"ignore:coroutine 'ClientCreatorContext.__aexit__' was never awaited:RuntimeWarning"
31
32
)
32
- class TestWrapperStore (StoreTests [WrapperStore [LocalStore ], Buffer ]):
33
- store_cls = WrapperStore [ LocalStore ]
34
- buffer_cls = Buffer
33
+ class TestWrapperStore (StoreTests [WrapperStore [Any ], Buffer ]):
34
+ store_cls = WrapperStore
35
+ buffer_cls = CPUBuffer
35
36
36
37
async def get (self , store : WrapperStore [LocalStore ], key : str ) -> Buffer :
37
38
return self .buffer_cls .from_bytes ((store ._store .root / key ).read_bytes ())
@@ -99,7 +100,7 @@ async def set(self, key: str, value: Buffer) -> None:
99
100
await super ().set (key , value )
100
101
101
102
key = "foo"
102
- value = Buffer .from_bytes (b"bar" )
103
+ value = CPUBuffer .from_bytes (b"bar" )
103
104
store_wrapped = NoisySetter (store )
104
105
await store_wrapped .set (key , value )
105
106
captured = capsys .readouterr ()
@@ -119,7 +120,7 @@ async def get(
119
120
await super ().get (key , prototype = prototype , byte_range = byte_range )
120
121
121
122
key = "foo"
122
- value = Buffer .from_bytes (b"bar" )
123
+ value = CPUBuffer .from_bytes (b"bar" )
123
124
store_wrapped = NoisyGetter (store )
124
125
await store_wrapped .set (key , value )
125
126
await store_wrapped .get (key , buffer_prototype )
0 commit comments