Skip to content

Commit

Permalink
TST: Ignore nan-warnings in randomized out tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
seberg authored and charris committed Dec 22, 2022
1 parent 3e2a0ba commit dc7bac6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions numpy/lib/tests/test_nanfunctions.py
Expand Up @@ -818,6 +818,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:
Expand Down Expand Up @@ -1021,6 +1022,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:
Expand Down

0 comments on commit dc7bac6

Please sign in to comment.