summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastianb@nvidia.com>2022-12-22 16:33:55 +0100
committerSebastian Berg <sebastianb@nvidia.com>2022-12-22 16:33:55 +0100
commit48623f63f6a564f9b65bdb8f0a26c026b65ea6e8 (patch)
tree12247cb24d3c22136b58ecfc12afead320f2c67e
parent0d1bb8e42228776dc8d35bdcfacf2ff3af366ade (diff)
downloadnumpy-48623f63f6a564f9b65bdb8f0a26c026b65ea6e8.tar.gz
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
-rw-r--r--numpy/lib/tests/test_nanfunctions.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_nanfunctions.py b/numpy/lib/tests/test_nanfunctions.py
index 45cacb792..257de381b 100644
--- a/numpy/lib/tests/test_nanfunctions.py
+++ b/numpy/lib/tests/test_nanfunctions.py
@@ -824,6 +824,7 @@ class TestNanFunctions_Median:
(-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 @@ class TestNanFunctions_Percentile:
(-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: