summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_shape_base.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2023-01-16 11:35:32 +0100
committerSebastian Berg <sebastianb@nvidia.com>2023-01-17 22:22:42 +0100
commitff78e59f5a4ff5b4c5fbf58228a6be8dab9480a8 (patch)
treea44875eed3db71d6aa146ed1d0466356094e2661 /numpy/lib/tests/test_shape_base.py
parent2303556949b96c4220ed86fa4554f6a87dec3842 (diff)
downloadnumpy-ff78e59f5a4ff5b4c5fbf58228a6be8dab9480a8.tar.gz
DEP: Finalize the non-sequence stacking deprecation
The `__array_function__` API currently will exhaust iterators so we cannot accept sequences reasonably. Checking for `__getitem__` is presumably enough to reject that (and was what the deprecation used). Future changes could allow this again, although it is not a useful API anyway, since we have to materialize the iterable in any case.
Diffstat (limited to 'numpy/lib/tests/test_shape_base.py')
-rw-r--r--numpy/lib/tests/test_shape_base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py
index 76058cf20..eb6628904 100644
--- a/numpy/lib/tests/test_shape_base.py
+++ b/numpy/lib/tests/test_shape_base.py
@@ -492,7 +492,7 @@ class TestColumnStack:
assert_equal(actual, expected)
def test_generator(self):
- with assert_warns(FutureWarning):
+ with pytest.raises(TypeError, match="arrays to stack must be"):
column_stack((np.arange(3) for _ in range(2)))
@@ -529,7 +529,7 @@ class TestDstack:
assert_array_equal(res, desired)
def test_generator(self):
- with assert_warns(FutureWarning):
+ with pytest.raises(TypeError, match="arrays to stack must be"):
dstack((np.arange(3) for _ in range(2)))