diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-03-23 10:12:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-23 10:12:07 -0500 |
commit | d5010b129e4f3714dcad04eb7115372848fbce36 (patch) | |
tree | c1db6f57913f97d2896024c9ce838f520f1e90e4 /numpy/lib/tests/test_function_base.py | |
parent | 9ae4a0d1ebc52a556ed13248172e8280ad9fc6bd (diff) | |
parent | 68563e997aab1208c71efec5698c24214d840cda (diff) | |
download | numpy-d5010b129e4f3714dcad04eb7115372848fbce36.tar.gz |
Merge pull request #15804 from eric-wieser/expire-delete-out-of-bounds
DEP: Make np.delete on out-of-bounds indices an error
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index a5988a719..05e5bff50 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -813,7 +813,6 @@ class TestDelete: # NOTE: The cast should be removed after warning phase for bools if not isinstance(indices, (slice, int, long, np.integer)): indices = np.asarray(indices, dtype=np.intp) - indices = indices[(indices >= 0) & (indices < 5)] assert_array_equal(setxor1d(a_del, self.a[indices, ]), self.a, err_msg=msg) xor = setxor1d(nd_a_del[0,:, 0], self.nd_a[0, indices, 0]) @@ -831,10 +830,10 @@ class TestDelete: def test_fancy(self): # Deprecation/FutureWarning tests should be kept after change. self._check_inverse_of_slicing(np.array([[0, 1], [2, 1]])) - with warnings.catch_warnings(): - warnings.filterwarnings('error', category=DeprecationWarning) - assert_raises(DeprecationWarning, delete, self.a, [100]) - assert_raises(DeprecationWarning, delete, self.a, [-100]) + with pytest.raises(IndexError): + delete(self.a, [100]) + with pytest.raises(IndexError): + delete(self.a, [-100]) with warnings.catch_warnings(record=True) as w: warnings.filterwarnings('always', category=FutureWarning) self._check_inverse_of_slicing([0, -1, 2, 2]) |