summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2015-09-27 16:09:43 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2015-09-27 16:14:45 +0200
commitf29c387272a9279f82ab04bbbe1bb68040b6d383 (patch)
tree65c6817dca9af8b0eed40a7ced74bb7984c4d152 /numpy/lib/tests
parentefd18a5455ea2b21eb0e3bd9ca9fab0d08e09526 (diff)
downloadnumpy-f29c387272a9279f82ab04bbbe1bb68040b6d383.tar.gz
TST: Test empty warning for split with manual inputs
Diffstat (limited to 'numpy/lib/tests')
-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 fb9d7f364..9a7fefb8d 100644
--- a/numpy/lib/tests/test_shape_base.py
+++ b/numpy/lib/tests/test_shape_base.py
@@ -111,6 +111,15 @@ class TestArraySplit(TestCase):
compare_results(res, desired)
assert_(a.dtype.type is res[-1].dtype.type)
+ # Same thing for manual splits:
+ res = assert_warns(FutureWarning, array_split, a, [0, 1, 2], axis=0)
+
+ # After removing the FutureWarning, the last should be zeros((0, 10))
+ desired = [np.array([]), np.array([np.arange(10)]),
+ np.array([np.arange(10)])]
+ compare_results(res, desired)
+ assert_(a.dtype.type is res[-1].dtype.type)
+
def test_integer_split_2D_cols(self):
a = np.array([np.arange(10), np.arange(10)])
res = array_split(a, 3, axis=-1)