From 48623f63f6a564f9b65bdb8f0a26c026b65ea6e8 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Thu, 22 Dec 2022 16:33:55 +0100 Subject: [PATCH] TST: Ignore nan-warnings in randomized out tests The tests randomize the nan pattern and thus can run into these (additional) warnings, so ignore them. (Could also fix the random seed, but this should do) Closes gh-22835 --- numpy/lib/tests/test_nanfunctions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/numpy/lib/tests/test_nanfunctions.py b/numpy/lib/tests/test_nanfunctions.py index 45cacb792051..257de381b394 100644 --- a/numpy/lib/tests/test_nanfunctions.py +++ b/numpy/lib/tests/test_nanfunctions.py @@ -824,6 +824,7 @@ def test_keepdims(self): (-3, -1), ] ) + @pytest.mark.filterwarnings("ignore:All-NaN slice:RuntimeWarning") def test_keepdims_out(self, axis): d = np.ones((3, 5, 7, 11)) # Randomly set some elements to NaN: @@ -1027,6 +1028,7 @@ def test_keepdims(self): (-3, -1), ] ) + @pytest.mark.filterwarnings("ignore:All-NaN slice:RuntimeWarning") def test_keepdims_out(self, q, axis): d = np.ones((3, 5, 7, 11)) # Randomly set some elements to NaN: