summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_shape_base.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-10-29 15:05:55 -0500
committerGitHub <noreply@github.com>2018-10-29 15:05:55 -0500
commite726c045c72833d5c826e8a13f889746ee0bfdf4 (patch)
treedc337946b0785d365ba23f4c7b7b22060b51d8be /numpy/lib/tests/test_shape_base.py
parentb2b532081b4b7fc15f97ffedb30a975aef835137 (diff)
parent00640218fcbc5d71f22550a9368da92358c8de96 (diff)
downloadnumpy-e726c045c72833d5c826e8a13f889746ee0bfdf4.tar.gz
Merge pull request #12280 from shoyer/stack-generator-warning
DEP: deprecate passing a generator to stack functions
Diffstat (limited to 'numpy/lib/tests/test_shape_base.py')
-rw-r--r--numpy/lib/tests/test_shape_base.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py
index a7f5ca7db..e338467f9 100644
--- a/numpy/lib/tests/test_shape_base.py
+++ b/numpy/lib/tests/test_shape_base.py
@@ -457,6 +457,7 @@ class TestSplit(object):
a = np.arange(10)
assert_raises(ValueError, split, a, 3)
+
class TestColumnStack(object):
def test_non_iterable(self):
assert_raises(TypeError, column_stack, 1)
@@ -481,6 +482,10 @@ class TestColumnStack(object):
actual = np.column_stack((a, b))
assert_equal(actual, expected)
+ def test_generator(self):
+ with assert_warns(FutureWarning):
+ column_stack((np.arange(3) for _ in range(2)))
+
class TestDstack(object):
def test_non_iterable(self):
@@ -514,6 +519,10 @@ class TestDstack(object):
desired = np.array([[[1, 1], [2, 2]]])
assert_array_equal(res, desired)
+ def test_generator(self):
+ with assert_warns(FutureWarning):
+ dstack((np.arange(3) for _ in range(2)))
+
# array_split has more comprehensive test of splitting.
# only do simple test on hsplit, vsplit, and dsplit