Skip to content

Commit ee6d62d

Browse files
committed
Revert "fix mypy in tests"
This reverts commit 34bf260.
1 parent 842bf95 commit ee6d62d

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

tests/test_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def test_open_with_mode_r(tmp_path: pathlib.Path) -> None:
235235
z2 = zarr.open(store=tmp_path, mode="r")
236236
assert isinstance(z2, Array)
237237
assert z2.fill_value == 1
238-
assert np.array(z2[:] == 1).all()
238+
assert (z2[:] == 1).all()
239239
with pytest.raises(ValueError):
240240
z2[:] = 3
241241

@@ -247,7 +247,7 @@ def test_open_with_mode_r_plus(tmp_path: pathlib.Path) -> None:
247247
zarr.ones(store=tmp_path, shape=(3, 3))
248248
z2 = zarr.open(store=tmp_path, mode="r+")
249249
assert isinstance(z2, Array)
250-
assert np.array(z2[:] == 1).all()
250+
assert (z2[:] == 1).all()
251251
z2[:] = 3
252252

253253

@@ -263,7 +263,7 @@ async def test_open_with_mode_a(tmp_path: pathlib.Path) -> None:
263263
arr[...] = 1
264264
z2 = zarr.open(store=tmp_path, mode="a")
265265
assert isinstance(z2, Array)
266-
assert np.array(z2[:] == 1).all()
266+
assert (z2[:] == 1).all()
267267
z2[:] = 3
268268

269269

@@ -1119,5 +1119,5 @@ def test_open_array_with_mode_r_plus(store: Store) -> None:
11191119
zarr.ones(store=store, shape=(3, 3))
11201120
z2 = zarr.open_array(store=store, mode="r+")
11211121
assert isinstance(z2, Array)
1122-
assert np.array(z2[:] == 1).all()
1122+
assert (z2[:] == 1).all()
11231123
z2[:] = 3

tests/test_array.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,15 +649,15 @@ def test_resize_1d(store: MemoryStore, zarr_format: ZarrFormat) -> None:
649649
a = np.arange(105, dtype="i4")
650650
z[:] = a
651651
assert (105,) == z.shape
652-
assert (105,) == z[:].shape # type: ignore
652+
assert (105,) == z[:].shape
653653
assert np.dtype("i4") == z.dtype
654-
assert np.dtype("i4") == z[:].dtype # type: ignore
654+
assert np.dtype("i4") == z[:].dtype
655655
assert (10,) == z.chunks
656656
np.testing.assert_array_equal(a, z[:])
657657

658658
z.resize(205)
659659
assert (205,) == z.shape
660-
assert (205,) == z[:].shape # type: ignore
660+
assert (205,) == z[:].shape
661661
assert np.dtype("i4") == z.dtype
662662
assert np.dtype("i4") == z[:].dtype
663663
assert (10,) == z.chunks

tests/test_buffer.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ async def test_async_array_prototype() -> None:
6262
prototype=my_prototype,
6363
)
6464
got = await a.getitem(selection=(slice(0, 9), slice(0, 9)), prototype=my_prototype)
65-
assert isinstance(got, TestNDArrayLike)
66-
assert np.array_equal(expect, got)
65+
# ignoring a mypy error here that TestNDArrayLike doesn't meet the NDArrayLike protocol
66+
# The test passes, so it clearly does.
67+
assert isinstance(got, TestNDArrayLike) # type: ignore[unreachable]
68+
assert np.array_equal(expect, got) # type: ignore[unreachable]
6769

6870

6971
@gpu_test
@@ -113,8 +115,10 @@ async def test_codecs_use_of_prototype() -> None:
113115
prototype=my_prototype,
114116
)
115117
got = await a.getitem(selection=(slice(0, 10), slice(0, 10)), prototype=my_prototype)
116-
assert isinstance(got, TestNDArrayLike)
117-
assert np.array_equal(expect, got)
118+
# ignoring a mypy error here that TestNDArrayLike doesn't meet the NDArrayLike protocol
119+
# The test passes, so it clearly does.
120+
assert isinstance(got, TestNDArrayLike) # type: ignore[unreachable]
121+
assert np.array_equal(expect, got) # type: ignore[unreachable]
118122

119123

120124
@gpu_test

0 commit comments

Comments
 (0)