summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2020-12-11 13:35:42 +0100
committerBas van Beek <b.f.van.beek@vu.nl>2020-12-11 13:59:51 +0100
commit347c40a8d677fb8d5c4bf71382bebcb81e4e1cec (patch)
treed5f493b68d405e30215f2c6dc846c7ab3c7afc8c
parent9d36f09cae3b09e61105e9222e0b56c0b1546a0c (diff)
downloadnumpy-347c40a8d677fb8d5c4bf71382bebcb81e4e1cec.tar.gz
TST: Updated the `np.flatiter` typing tests
-rw-r--r--numpy/typing/tests/data/pass/flatiter.py2
-rw-r--r--numpy/typing/tests/data/reveal/flatiter.py21
2 files changed, 14 insertions, 9 deletions
diff --git a/numpy/typing/tests/data/pass/flatiter.py b/numpy/typing/tests/data/pass/flatiter.py
index c0219eb2b..4fdf25299 100644
--- a/numpy/typing/tests/data/pass/flatiter.py
+++ b/numpy/typing/tests/data/pass/flatiter.py
@@ -12,3 +12,5 @@ a[0]
a[[0, 1, 2]]
a[...]
a[:]
+a.__array__()
+a.__array__(np.float64)
diff --git a/numpy/typing/tests/data/reveal/flatiter.py b/numpy/typing/tests/data/reveal/flatiter.py
index 56cdc7a0e..221101ebb 100644
--- a/numpy/typing/tests/data/reveal/flatiter.py
+++ b/numpy/typing/tests/data/reveal/flatiter.py
@@ -1,14 +1,17 @@
+from typing import Any
import numpy as np
-a: "np.flatiter[np.ndarray]"
+a: np.flatiter[np.ndarray[Any, np.dtype[np.str_]]]
-reveal_type(a.base) # E: numpy.ndarray*
-reveal_type(a.copy()) # E: numpy.ndarray*
+reveal_type(a.base) # E: numpy.ndarray[Any, numpy.dtype[numpy.str_]]
+reveal_type(a.copy()) # E: numpy.ndarray[Any, numpy.dtype[numpy.str_]]
reveal_type(a.coords) # E: tuple[builtins.int]
reveal_type(a.index) # E: int
-reveal_type(iter(a)) # E: Iterator[numpy.generic*]
-reveal_type(next(a)) # E: numpy.generic
-reveal_type(a[0]) # E: numpy.generic
-reveal_type(a[[0, 1, 2]]) # E: numpy.ndarray*
-reveal_type(a[...]) # E: numpy.ndarray*
-reveal_type(a[:]) # E: numpy.ndarray*
+reveal_type(iter(a)) # E: Iterator[numpy.str_]
+reveal_type(next(a)) # E: numpy.str_
+reveal_type(a[0]) # E: numpy.str_
+reveal_type(a[[0, 1, 2]]) # E: numpy.ndarray[Any, numpy.dtype[numpy.str_]]
+reveal_type(a[...]) # E: numpy.ndarray[Any, numpy.dtype[numpy.str_]]
+reveal_type(a[:]) # E: numpy.ndarray[Any, numpy.dtype[numpy.str_]]
+reveal_type(a.__array__()) # E: numpy.ndarray[Any, numpy.dtype[numpy.str_]]
+reveal_type(a.__array__(np.float64)) # E: numpy.ndarray[Any, numpy.dtype[Any]]