TST: replace pytest.warns(None) in test_plot_partial_dependence.py
@@ -3,6 +3,7 @@ from scipy.stats.mstats import mquantiles
import pytest
from numpy.testing import assert_allclose
+import warnings
from sklearn.datasets import load_diabetes
from sklearn.datasets import load_iris
@@ -770,7 +771,8 @@ def test_partial_dependence_display_deprecation(
with pytest.warns(FutureWarning, match=deprecation_msg):
disp.plot(pdp_lim=None)
# case when constructor and method parameters are different
- with pytest.warns(None) as record:
+ with warnings.catch_warnings(record=True) as record:
+ warnings.simplefilter("always", FutureWarning)
disp.plot(pdp_lim=(0, 1))
assert len(record) == 2
for warning in record:
