diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2015-09-10 12:02:38 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-09-10 12:02:38 -0600 |
commit | 0b0206c1617841ed2e5324de752ee8ede2cce791 (patch) | |
tree | e06fbf8d42e288be9ca5f205884acc0381f867ee /numpy/lib/tests/test_function_base.py | |
parent | 438cdd3d75a0bb606e7ab7f96e59744c9b78d748 (diff) | |
parent | dbe5cef95dcaa3c48dad1093084b7d2b65cf889b (diff) | |
download | numpy-0b0206c1617841ed2e5324de752ee8ede2cce791.tar.gz |
Merge pull request #6271 from charris/change-deprecated-indexes-to-error
DEP,MAINT: Change deprecated indexing to errors.
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 6a9d76a27..5e758fb89 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -1913,19 +1913,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)) |