diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-12-20 15:16:06 -0800 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-12-20 15:16:06 -0800 |
commit | 86df1b137af94fc5f1af7b9e5f14f30d065ad26e (patch) | |
tree | daa4fe3f34ac7037197cdbb3ee95cff7d8aa7800 /numpy/lib/tests | |
parent | d68a6b84a455ac8a39eee74f16470255843970c4 (diff) | |
parent | c91b4c3703eef84eca84063994d07332020c7707 (diff) | |
download | numpy-86df1b137af94fc5f1af7b9e5f14f30d065ad26e.tar.gz |
Merge pull request #4102 from seberg/issue-612
FIX: Array split should not hack empty array shape away
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_shape_base.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py index 55b008871..d6d01ba99 100644 --- a/numpy/lib/tests/test_shape_base.py +++ b/numpy/lib/tests/test_shape_base.py @@ -100,9 +100,12 @@ class TestArraySplit(TestCase): def test_integer_split_2D_rows(self): a = array([arange(10), arange(10)]) - res = array_split(a, 3, axis=0) + res = assert_warns(FutureWarning, array_split, a, 3, axis=0) + + # After removing the FutureWarning, the last should be zeros((0, 10)) desired = [array([arange(10)]), array([arange(10)]), array([])] compare_results(res, desired) + assert_(a.dtype.type is res[-1].dtype.type) def test_integer_split_2D_cols(self): a = array([arange(10), arange(10)]) @@ -116,9 +119,12 @@ class TestArraySplit(TestCase): """ This will fail if we change default axis """ a = array([arange(10), arange(10)]) - res = array_split(a, 3) + res = assert_warns(FutureWarning, array_split, a, 3) + + # After removing the FutureWarning, the last should be zeros((0, 10)) desired = [array([arange(10)]), array([arange(10)]), array([])] compare_results(res, desired) + assert_(a.dtype.type is res[-1].dtype.type) #perhaps should check higher dimensions def test_index_split_simple(self): |