Skip to content

Commit 25e6e11

Browse files
Bas van BeekBvB93
authored andcommitted
ENH: Add annotations for <module>.test objects
1 parent a2a5b30 commit 25e6e11

File tree

11 files changed

+31
-0
lines changed

11 files changed

+31
-0
lines changed

numpy/__init__.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ from abc import abstractmethod
88
from types import TracebackType, MappingProxyType
99
from contextlib import ContextDecorator
1010

11+
from numpy._pytesttester import PytestTester
1112
from numpy.core.multiarray import flagsobj
1213
from numpy.core._internal import _ctypes
1314
from numpy.typing import (
@@ -610,6 +611,7 @@ __all__: List[str]
610611
__path__: List[str]
611612
__version__: str
612613
__git_version__: str
614+
test: PytestTester
613615

614616
# TODO: Move placeholders to their respective module once
615617
# their annotations are properly implemented

numpy/f2py/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import subprocess
33
from typing import Any, List, Iterable, Dict, overload
44
from typing_extensions import TypedDict, Literal as L
55

6+
from numpy._pytesttester import PytestTester
7+
68
class _F2PyDictBase(TypedDict):
79
csrc: List[str]
810
h: List[str]
@@ -13,6 +15,7 @@ class _F2PyDict(_F2PyDictBase, total=False):
1315

1416
__all__: List[str]
1517
__path__: List[str]
18+
test: PytestTester
1619

1720
def run_main(comline_list: Iterable[str]) -> Dict[str, _F2PyDict]: ...
1821

numpy/fft/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from typing import Any, List
22

3+
from numpy._pytesttester import PytestTester
4+
35
__all__: List[str]
6+
test: PytestTester
47

58
def fft(a, n=..., axis=..., norm=...): ...
69
def ifft(a, n=..., axis=..., norm=...): ...

numpy/lib/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import math as math
22
from typing import Any, List
33

4+
from numpy._pytesttester import PytestTester
5+
46
from numpy import (
57
ndenumerate as ndenumerate,
68
ndindex as ndindex,
@@ -231,6 +233,7 @@ from numpy.core.multiarray import (
231233
)
232234

233235
__all__: List[str]
236+
test: PytestTester
234237

235238
__version__ = version
236239
emath = scimath

numpy/linalg/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from typing import Any, List
22

3+
from numpy._pytesttester import PytestTester
4+
35
__all__: List[str]
6+
test: PytestTester
47

58
class LinAlgError(Exception): ...
69

numpy/ma/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Any, List
22

3+
from numpy._pytesttester import PytestTester
4+
35
from numpy.ma import extras as extras
46

57
from numpy.ma.core import (
@@ -230,3 +232,4 @@ from numpy.ma.extras import (
230232
)
231233

232234
__all__: List[str]
235+
test: PytestTester

numpy/matrixlib/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
from typing import Any, List
22

3+
from numpy._pytesttester import PytestTester
4+
35
from numpy import (
46
matrix as matrix,
57
)
68

79
__all__: List[str]
10+
test: PytestTester
811

912
def bmat(obj, ldict=..., gdict=...): ...
1013
def asmatrix(data, dtype=...): ...

numpy/polynomial/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import List
22

3+
from numpy._pytesttester import PytestTester
4+
35
from numpy.polynomial import (
46
chebyshev as chebyshev,
57
hermite as hermite,
@@ -16,5 +18,6 @@ from numpy.polynomial.legendre import Legendre as Legendre
1618
from numpy.polynomial.polynomial import Polynomial as Polynomial
1719

1820
__all__: List[str]
21+
test: PytestTester
1922

2023
def set_default_printstyle(style): ...

numpy/random/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import List
22

3+
from numpy._pytesttester import PytestTester
4+
35
from numpy.random._generator import Generator as Generator
46
from numpy.random._generator import default_rng as default_rng
57
from numpy.random._mt19937 import MT19937 as MT19937
@@ -66,3 +68,4 @@ from numpy.random.mtrand import (
6668
)
6769

6870
__all__: List[str]
71+
test: PytestTester

numpy/testing/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import List
22

3+
from numpy._pytesttester import PytestTester
4+
35
from unittest import (
46
TestCase as TestCase,
57
)
@@ -47,6 +49,7 @@ from numpy.testing._private.utils import (
4749
)
4850

4951
__all__: List[str]
52+
test: PytestTester
5053

5154
def run_module_suite(
5255
file_to_run: None | str = ...,

0 commit comments

Comments
 (0)