Skip to content

Commit 3f7b3f5

Browse files
jorenhamguan404ming
andcommitted
🤡 work around incorrect typeshed annotation for unittest.TestCase
Co-authored-by: Guan Ming(Wesley) Chiu <[email protected]>
1 parent 40f178b commit 3f7b3f5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

‎src/numpy-stubs/ma/testutils.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from unittest import TestCase
1+
from unittest import TestCase as _TestCase
22

33
import numpy as np
44
import numpy.typing as npt
@@ -66,3 +66,6 @@ def assert_mask_equal(m1: object, m2: object, err_msg: str = "") -> None: ...
6666

6767
assert_not_equal = fail_if_equal
6868
assert_close = assert_almost_equal
69+
70+
class TestCase(_TestCase):
71+
def __init_subclass__(cls, *args: object, **kwargs: object) -> None: ...

‎tool/.mypyignore.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ numpy\.testing(\._private\.utils)?\.check_support_sve
3232

3333
# stdlib re-exports with incorrect typeshed stubs
3434
numpy\.compat(\.py3k)?\.os_PathLike\.__class_getitem__
35-
numpy\.(testing|ma\.testutils)\.TestCase\.__init_subclass__
35+
numpy\.testing\.TestCase\.__init_subclass__

0 commit comments

Comments
 (0)