10000 TST: Test empty warning for split with manual inputs · numpy/numpy@2a3ac6f · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a3ac6f

Browse files
sebergcharris
authored andcommitted
TST: Test empty warning for split with manual inputs
1 parent 79ed6ee commit 2a3ac6f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

numpy/lib/tests/test_shape_base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ def test_integer_split_2D_rows(self):
111111
compare_results(res, desired)
112112
assert_(a.dtype.type is res[-1]. 83F4 dtype.type)
113113

114+
# Same thing for manual splits:
115+
res = assert_warns(FutureWarning, array_split, a, [0, 1, 2], axis=0)
116+
117+
# After removing the FutureWarning, the last should be zeros((0, 10))
118+
desired = [np.array([]), np.array([np.arange(10)]),
119+
np.array([np.arange(10)])]
120+
compare_results(res, desired)
121+
assert_(a.dtype.type is res[-1].dtype.type)
122+
114123
def test_integer_split_2D_cols(self):
115124
a = np.array([np.arange(10), np.arange(10)])
116125
res = array_split(a, 3, axis=-1)

0 commit comments

Comments
 (0)
0