|
| 1 | +change test for a warning to filterwarnings since the code may or not issue a warning depending on an arch |
| 2 | +see https://github.com/scipy/scipy/issues/17954 + https://github.com/scipy/scipy/pull/17975 |
| 3 | +diff --git a/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py b/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py |
| 4 | +index afd7a106ea0..87f3756c37d 100644 |
| 5 | +--- a/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py |
| 6 | ++++ b/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py |
| 7 | +@@ -255,17 +255,18 @@ |
| 8 | + _check_fiedler(12, 2) |
| 9 | + |
| 10 | + |
| 11 | +-@pytest.mark.skipif(platform.machine() == 'aarch64', |
| 12 | +- reason="issue #15935") |
| 13 | ++@pytest.mark.filterwarnings("ignore:Failed at iteration") |
| 14 | ++@pytest.mark.filterwarnings("ignore:Exited at iteration") |
| 15 | ++@pytest.mark.filterwarnings("ignore:Exited postprocessing") |
| 16 | + def test_failure_to_run_iterations(): |
| 17 | + """Check that the code exists gracefully without breaking. Issue #10974. |
| 18 | ++ The code may or not issue a warning, filtered out. Issue #15935, #17954. |
| 19 | + """ |
| 20 | + rnd = np.random.RandomState(0) |
| 21 | + X = rnd.standard_normal((100, 10)) |
| 22 | + A = X @ X.T |
| 23 | + Q = rnd.standard_normal((X.shape[0], 4)) |
| 24 | +- with pytest.warns(UserWarning, match="Failed at iteration"): |
| 25 | +- eigenvalues, _ = lobpcg(A, Q, maxiter=40, tol=1e-12) |
| 26 | ++ eigenvalues, _ = lobpcg(A, Q, maxiter=40, tol=1e-12) |
| 27 | + assert(np.max(eigenvalues) > 0) |
| 28 | + |
| 29 | + |
0 commit comments