From efa1bd2c0de6cd9c07b410002f2e1c0bae8cf385 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sun, 26 Mar 2017 10:38:28 +0100 Subject: MAINT: Reuse _validate_axis in np.gradient This also means that its axis argument invokes operator.index like others do. _validate_axis currently accepts lists of axes, which is a bug. --- numpy/lib/tests/test_function_base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'numpy/lib/tests/test_function_base.py') diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 708b20482..6c6ed5941 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -902,9 +902,9 @@ class TestGradient(TestCase): # test maximal number of varargs assert_raises(TypeError, gradient, x, 1, 2, axis=1) - assert_raises(ValueError, gradient, x, axis=3) - assert_raises(ValueError, gradient, x, axis=-3) - assert_raises(TypeError, gradient, x, axis=[1,]) + assert_raises(np.AxisError, gradient, x, axis=3) + assert_raises(np.AxisError, gradient, x, axis=-3) + # assert_raises(TypeError, gradient, x, axis=[1,]) def test_timedelta64(self): # Make sure gradient() can handle special types like timedelta64 -- cgit v1.2.1