diff options
author | Félix Hartmann <felix.hartmann@crans.org> | 2013-07-09 15:49:32 +0200 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-08-02 14:36:24 -0600 |
commit | ea768739dab69c0b67488179ffa67d57d63d59f8 (patch) | |
tree | a2a043f988f655b5fa3e8093c6420897c1c554d1 /numpy/lib/tests/test_function_base.py | |
parent | 496813f1a23363bbd50a62a60c37f6bd4e10649b (diff) | |
download | numpy-ea768739dab69c0b67488179ffa67d57d63d59f8.tar.gz |
BUG: Make np.insert check for out of bounds axis arguments.
Also add test for IndexError exception when axis is out of bounds.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 13f907d5a..de561e55a 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -218,6 +218,10 @@ class TestInsert(TestCase): assert_equal(insert(a, 1, a[:,2,:], axis=-2), insert(a, 1, a[:,2,:], axis=1)) + # invalid axis value + assert_raises(IndexError, insert, a, 1, a[:,2,:], axis=3) + assert_raises(IndexError, insert, a, 1, a[:,2,:], axis=-4) + def test_0d(self): # This is an error in the future a = np.array(1) |