diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2020-03-23 16:10:06 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2020-03-23 16:10:06 +0000 |
commit | 86dd5ce7ffd4370add745a4b57c1ed67c3d9261f (patch) | |
tree | 93830383d3443d3f4ec89ad9601cdccaa9c6e4a3 | |
parent | 68563e997aab1208c71efec5698c24214d840cda (diff) | |
download | numpy-86dd5ce7ffd4370add745a4b57c1ed67c3d9261f.tar.gz |
TST: Remove code that is not supposed to warn out of warning assertion
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index b29e75471..af0b5d91a 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -828,11 +828,15 @@ class TestDelete: delete(self.a, [100]) with pytest.raises(IndexError): delete(self.a, [-100]) + + self._check_inverse_of_slicing([0, -1, 2, 2]) + with warnings.catch_warnings(record=True) as w: warnings.filterwarnings('always', category=FutureWarning) - self._check_inverse_of_slicing([0, -1, 2, 2]) obj = np.array([True, False, False], dtype=bool) self._check_inverse_of_slicing(obj) + # _check_inverse_of_slicing operates on two arrays, so warns twice + assert len(w) == 2 assert_(w[0].category is FutureWarning) assert_(w[1].category is FutureWarning) |