Skip to content

Commit fc0937e

Browse files
committed
ignore unavoidable mypy error
1 parent 359eb66 commit fc0937e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/zarr/core/buffer/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def ravel(self, order: Literal["K", "A", "C", "F"] = "C") -> Self:
171171
def all(self) -> bool:
172172
return bool(self._value)
173173

174-
def __eq__(self, other: object) -> Self:
174+
def __eq__(self, other: object) -> Self: # type: ignore[explicit-override, override]
175175
return self.__class__(self._value == other)
176176

177177
def __repr__(self) -> str:

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)