Skip to content

Commit 71f7085

Browse files
authored
TST Filter out warning for pyamg using deprecated behavior (#19312)
1 parent 88be2ab commit 71f7085

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

sklearn/cluster/tests/test_spectral.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ def test_discretize(n_samples):
196196
# https://github.com/scikit-learn/scikit-learn/issues/15913
197197
@pytest.mark.filterwarnings(
198198
"ignore:scipy.rand is deprecated:DeprecationWarning:pyamg.*")
199+
# TODO: Remove when pyamg removes the use of np.float
200+
@pytest.mark.filterwarnings(
201+
"ignore:`np.float` is a deprecated alias:DeprecationWarning:pyamg.*")
199202
def test_spectral_clustering_with_arpack_amg_solvers():
200203
# Test that spectral_clustering is the same for arpack and amg solver
201204
# Based on toy example from plot_segmentation_toy.py

sklearn/manifold/tests/test_spectral_embedding.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ def test_spectral_embedding_callable_affinity(X, seed=36):
181181
# https://github.com/scikit-learn/scikit-learn/issues/15913
182182
@pytest.mark.filterwarnings(
183183
"ignore:scipy.rand is deprecated:DeprecationWarning:pyamg.*")
184+
# TODO: Remove when pyamg removes the use of np.float
185+
@pytest.mark.filterwarnings(
186+
"ignore:`np.float` is a deprecated alias:DeprecationWarning:pyamg.*")
184187
def test_spectral_embedding_amg_solver(seed=36):
185188
# Test spectral embedding with amg solver
186189
pytest.importorskip('pyamg')
@@ -216,6 +219,9 @@ def test_spectral_embedding_amg_solver(seed=36):
216219
# https://github.com/scikit-learn/scikit-learn/issues/15913
217220
@pytest.mark.filterwarnings(
218221
"ignore:scipy.rand is deprecated:DeprecationWarning:pyamg.*")
222+
# TODO: Remove when pyamg removes the use of np.float
223+
@pytest.mark.filterwarnings(
224+
"ignore:`np.float` is a deprecated alias:DeprecationWarning:pyamg.*")
219225
def test_spectral_embedding_amg_solver_failure():
220226
# Non-regression test for amg solver failure (issue #13393 on github)
221227
pytest.importorskip('pyamg')

0 commit comments

Comments
 (0)