diff options
Diffstat (limited to 'numpy/tests')
-rw-r--r-- | numpy/tests/test_public_api.py | 3 | ||||
-rw-r--r-- | numpy/tests/typing/fail/array_like.py | 8 | ||||
-rw-r--r-- | numpy/tests/typing/pass/array_like.py | 10 |
3 files changed, 5 insertions, 16 deletions
diff --git a/numpy/tests/test_public_api.py b/numpy/tests/test_public_api.py index 7ce74bc43..beaf38e5a 100644 --- a/numpy/tests/test_public_api.py +++ b/numpy/tests/test_public_api.py @@ -98,7 +98,7 @@ def test_dir_testing(): """Assert that output of dir has only one "testing/tester" attribute without duplicate""" assert len(dir(np)) == len(set(dir(np))) - + def test_numpy_linalg(): bad_results = check_dir(np.linalg) @@ -176,6 +176,7 @@ PUBLIC_MODULES = ['numpy.' + s for s in [ "polynomial.polyutils", "random", "testing", + "typing", "version", ]] diff --git a/numpy/tests/typing/fail/array_like.py b/numpy/tests/typing/fail/array_like.py index a5ef5795f..a97e72dc7 100644 --- a/numpy/tests/typing/fail/array_like.py +++ b/numpy/tests/typing/fail/array_like.py @@ -1,11 +1,5 @@ -from typing import Any, TYPE_CHECKING - import numpy as np - -if TYPE_CHECKING: - from numpy.typing import ArrayLike -else: - ArrayLike = Any +from numpy.typing import ArrayLike class A: diff --git a/numpy/tests/typing/pass/array_like.py b/numpy/tests/typing/pass/array_like.py index 098149c4b..e668b4963 100644 --- a/numpy/tests/typing/pass/array_like.py +++ b/numpy/tests/typing/pass/array_like.py @@ -1,13 +1,7 @@ -from typing import Any, List, Optional, TYPE_CHECKING +from typing import Any, List, Optional import numpy as np - -if TYPE_CHECKING: - from numpy.typing import ArrayLike, DtypeLike, _SupportsArray -else: - ArrayLike = Any - DtypeLike = Any - _SupportsArray = Any +from numpy.typing import ArrayLike, DtypeLike, _SupportsArray x1: ArrayLike = True x2: ArrayLike = 5 |