Skip to content

Commit dc7bac6

Browse files
sebergcharris
authored andcommitted
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
1 parent 3e2a0ba commit dc7bac6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

numpy/lib/tests/test_nanfunctions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ def test_keepdims(self):
818818
(-3, -1),
819819
]
820820
)
821+
@pytest.mark.filterwarnings("ignore:All-NaN slice:RuntimeWarning")
821822
def test_keepdims_out(self, axis):
822823
d = np.ones((3, 5, 7, 11))
823824
# Randomly set some elements to NaN:
@@ -1021,6 +1022,7 @@ def test_keepdims(self):
10211022
(-3, -1),
10221023
]
10231024
)
1025+
@pytest.mark.filterwarnings("ignore:All-NaN slice:RuntimeWarning")
10241026
def test_keepdims_out(self, q, axis):
10251027
d = np.ones((3, 5, 7, 11))
10261028
# Randomly set some elements to NaN:

0 commit comments

Comments
 (0)