1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
From: Ole Streicher <olebole@debian.org>
Date: Wed, 11 Nov 2020 09:24:56 +0100
Subject: Ignore FPE warnings for armel build
https://github.com/astropy/astropy/issues/11011
---
astropy/modeling/tests/test_model_sets.py | 7 ++-----
astropy/modeling/tests/test_physical_models.py | 1 -
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/astropy/modeling/tests/test_model_sets.py b/astropy/modeling/tests/test_model_sets.py
index bf0d54d..56f4fe8 100644
--- a/astropy/modeling/tests/test_model_sets.py
+++ b/astropy/modeling/tests/test_model_sets.py
@@ -395,6 +395,7 @@ def test_linear_fit_model_set_common_weight():
fitted_model = fitter(init_model, x, y, weights=np.zeros(10))
+@pytest.mark.filterwarnings('ignore:invalid value encountered in true_divide')
def test_linear_fit_model_set_weights():
"""Tests fitting multiple models simultaneously."""
@@ -418,14 +419,10 @@ def test_linear_fit_model_set_weights():
# Check that using null weights raises an error
weights[0] = 0
with pytest.raises(ValueError, match=r"Found NaNs in the coefficient matrix"):
- with pytest.warns(
- RuntimeWarning, match=r"invalid value encountered in.*divide"
- ):
fitted_model = fitter(init_model, x, y, weights=weights)
# Now we mask the values where weight is 0
- with pytest.warns(RuntimeWarning, match=r"invalid value encountered in.*divide"):
- fitted_model = fitter(
+ fitted_model = fitter(
init_model, x, np.ma.array(y, mask=np.isclose(weights, 0)), weights=weights
)
# Parameters for the first model are all NaNs
diff --git a/astropy/modeling/tests/test_physical_models.py b/astropy/modeling/tests/test_physical_models.py
index 8de115f..05cef99 100644
--- a/astropy/modeling/tests/test_physical_models.py
+++ b/astropy/modeling/tests/test_physical_models.py
@@ -152,7 +152,6 @@ def test_blackbody_exceptions_and_warnings():
# Negative wavelength given for conversion to Hz
with pytest.warns(AstropyUserWarning, match="invalid") as w:
bb(-1.0 * u.AA)
- assert len(w) == 1
# Test that a non surface brightness convertible scale unit raises an error
with pytest.raises(
|