8000 TST: Fix #6542: Add test for non-iterable input... · gkBCCN/numpy@8e05d78 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8e05d78

Browse files
committed
TST: Fix numpy#6542: Add test for non-iterable input...
...to hstack, vstack, and stack
1 parent 1373aa7 commit 8e05d78

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

numpy/core/tests/test_shape_base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ def test_3D_array(self):
120120

121121

122122
class TestHstack(TestCase):
123+
def test_non_iterable(self):
124+
assert_raises(TypeError, hstack, 1)
125+
123126
def test_0D_array(self):
124127
a = array(1)
125128
b = array(2)
@@ -143,6 +146,9 @@ def test_2D_array(self):
143146

144147

145148
class TestVstack(TestCase):
149+
def test_non_iterable(self):
150+
assert_raises(TypeError, vstack, 1)
151+
146152
def test_0D_array(self):
147153
a = array(1)
148154
b = array(2)
@@ -265,6 +271,9 @@ def test_concatenate(self):
265271

266272

267273
def test_stack():
274+
# non-iterable input
275+
assert_raises(TypeError, stack, 1)
276+
268277
# 0d input
269278
for input_ in [(1, 2, 3),
270279
[np.int32(1), np.int32(2), np.int32(3)],

0 commit comments

Comments
 (0)
0