Skip to content

Commit fc72752

Browse files
committed
handle more warnings
1 parent 33a9184 commit fc72752

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/test_buffer.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ async def test_codecs_use_of_gpu_prototype() -> None:
146146
value=expect[:],
147147
prototype=gpu.buffer_prototype,
148148
)
149-
got = await a.getitem(selection=(slice(0, 10), slice(0, 10)), prototype=gpu.buffer_prototype)
149+
with pytest.warns(ZarrUserWarning, match=msg):
150+
got = await a.getitem(
151+
selection=(slice(0, 10), slice(0, 10)), prototype=gpu.buffer_prototype
152+
)
150153
assert isinstance(got, cp.ndarray)
151154
assert cp.array_equal(expect, got)
152155

@@ -173,9 +176,10 @@ async def test_sharding_use_of_gpu_prototype() -> None:
173176
value=expect[:],
174177
prototype=gpu.buffer_prototype,
175178
)
176-
got = await a.getitem(
177-
selection=(slice(0, 10), slice(0, 10)), prototype=gpu.buffer_prototype
178-
)
179+
with pytest.warns(ZarrUserWarning, match=msg):
180+
got = await a.getitem(
181+
selection=(slice(0, 10), slice(0, 10)), prototype=gpu.buffer_prototype
182+
)
179183
assert isinstance(got, cp.ndarray)
180184
assert cp.array_equal(expect, got)
181185

0 commit comments

Comments
 (0)