From 86dd5ce7ffd4370add745a4b57c1ed67c3d9261f Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Mon, 23 Mar 2020 16:10:06 +0000 Subject: TST: Remove code that is not supposed to warn out of warning assertion --- numpy/lib/tests/test_function_base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (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 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) -- cgit v1.2.1