diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-08-29 18:46:21 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-09-06 16:36:42 -0600 |
commit | c87c7a612ee7f90281797e447255c402b099c73a (patch) | |
tree | 4e761ce48aa0e79bead72b563217545ba2037c75 /numpy/lib/tests/test_function_base.py | |
parent | 7001d613aaa445ff650a273ec3d4db6787daf2e3 (diff) | |
download | numpy-c87c7a612ee7f90281797e447255c402b099c73a.tar.gz |
DEP,MAINT: Change deprecated indexing to errors.
The deprecated operations changed to errors are
* Conversion of floats and booleans to npy_intp indexes.
* Conversion of single element integer arrays of ndim > 1 to indexes.
* Multiple ellipsis in index.
The affected deprecation tests have been been changed to check for
raised errors instead, but remain in test_deprecations.py for the
moment. They will be moved when the conversion of the remaining indexing
deprecations is complete.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index af9315d83..8a814e168 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -1888,19 +1888,25 @@ class TestBincount(TestCase): def test_with_incorrect_minlength(self): x = np.array([], dtype=int) - assert_raises_regex(TypeError, "an integer is required", + assert_raises_regex(TypeError, + "'str' object cannot be interpreted", lambda: np.bincount(x, minlength="foobar")) - assert_raises_regex(ValueError, "must be positive", + assert_raises_regex(ValueError, + "must be positive", lambda: np.bincount(x, minlength=-1)) - assert_raises_regex(ValueError, "must be positive", + assert_raises_regex(ValueError, + "must be positive", lambda: np.bincount(x, minlength=0)) x = np.arange(5) - assert_raises_regex(TypeError, "an integer is required", + assert_raises_regex(TypeError, + "'str' object cannot be interpreted", lambda: np.bincount(x, minlength="foobar")) - assert_raises_regex(ValueError, "minlength must be positive", + assert_raises_regex(ValueError, + "minlength must be positive", lambda: np.bincount(x, minlength=-1)) - assert_raises_regex(ValueError, "minlength must be positive", + assert_raises_regex(ValueError, + "minlength must be positive", lambda: np.bincount(x, minlength=0)) |