File: Make-some-tests-xfail-that-sometimes-fail-under-mips64el.patch

package info (click to toggle)
astropy 7.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 35,328 kB
  • sloc: python: 233,437; ansic: 55,264; javascript: 17,680; lex: 8,621; sh: 3,317; xml: 2,287; makefile: 191
file content (214 lines) | stat: -rw-r--r-- 9,707 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
From: Ole Streicher <olebole@debian.org>
Date: Fri, 20 Dec 2019 13:11:42 +0100
Subject: Make some tests xfail that sometimes fail under mips64el
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

https://github.com/astropy/astropy/issues/17363
https://github.com/astropy/astropy/issues/17403
https://github.com/astropy/astropy/issues/12416

One failure we get is

    def test_doubleComplex(self):
        assert issubclass(self.array['doubleComplex'].dtype.type,
                          np.complex128)
>       assert_array_equal(
            self.array['doubleComplex'],
            [np.nan+0j, 0+0j, 0+-1j, np.nan+(np.inf*1j), np.nan+0j])
[…]
E       Arrays are not equal
E        x: MaskedArray([inf+infj,  0. +0.j,  0. -1.j, inf+infj, inf+infj])
E        y: array([nan +0.j,  0. +0.j,  0. -1.j, nan+infj, nan +0.j])

astropy/io/votable/tests/vo_test.py:478: ValueError
---
 astropy/io/votable/tests/test_vo.py                                   | 1 +
 astropy/modeling/tests/test_fitters.py                                | 4 ++++
 astropy/modeling/tests/test_functional_models.py                      | 3 +++
 astropy/modeling/tests/test_models.py                                 | 2 ++
 astropy/modeling/tests/test_models_quantities.py                      | 4 ++++
 .../lombscargle_multiband/tests/test_lombscargle_multiband.py         | 1 +
 astropy/units/tests/test_quantity_ufuncs.py                           | 4 ++--
 astropy/visualization/wcsaxes/tests/test_misc.py                      | 1 +
 8 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/astropy/io/votable/tests/test_vo.py b/astropy/io/votable/tests/test_vo.py
index 8e5f0f3..1b12b17 100644
--- a/astropy/io/votable/tests/test_vo.py
+++ b/astropy/io/votable/tests/test_vo.py
@@ -569,6 +569,7 @@ class TestParse:
         )
         assert_array_equal(self.mask["floatComplex"], [True, False, False, True, True])
 
+    @pytest.mark.xfail(reason="Failure on MIPS")
     def test_doubleComplex(self):
         assert issubclass(self.array["doubleComplex"].dtype.type, np.complex128)
         assert_array_equal(
diff --git a/astropy/modeling/tests/test_fitters.py b/astropy/modeling/tests/test_fitters.py
index 3fcdfd8..011cd5c 100644
--- a/astropy/modeling/tests/test_fitters.py
+++ b/astropy/modeling/tests/test_fitters.py
@@ -377,6 +377,7 @@ class TestLinearLSQFitter:
 
 
 @pytest.mark.skipif(not HAS_SCIPY, reason="requires scipy")
+@pytest.mark.xfail(reason="Failure on MIPS")
 class TestNonLinearFitters:
     """Tests non-linear least squares fitting and the SLSQP algorithm."""
 
@@ -640,6 +641,7 @@ class TestNonLinearFitters:
         assert_allclose(fmod.parameters, beta.ravel())
         assert_allclose(olscov, fitter.fit_info["param_cov"])
 
+    @pytest.mark.xfail(reason="Failure on MIPS")
     @pytest.mark.parametrize("fitter", non_linear_fitters)
     def test_param_cov_with_uncertainties(self, fitter):
         """
@@ -1264,6 +1266,7 @@ def test_fitting_with_outlier_removal_niter():
 
 
 @pytest.mark.skipif(not HAS_SCIPY, reason="requires scipy")
+@pytest.mark.xfail(reason="Failure on MIPS")
 class TestFittingUncertanties:
     """
     Test that parameter covariance is calculated correctly for the fitters
@@ -1325,6 +1328,7 @@ class TestFittingUncertanties:
             np.sqrt(np.diag(cov_1d_set_linlsq[0])), fit_1d_set_linlsq.stds[0].stds
         )
 
+    @pytest.mark.xfail(reason="Failure on MIPS")
     @pytest.mark.parametrize("fitter", non_linear_fitters)
     def test_2d_models(self, fitter):
         """
diff --git a/astropy/modeling/tests/test_functional_models.py b/astropy/modeling/tests/test_functional_models.py
index 9c21c0b..b73b221 100644
--- a/astropy/modeling/tests/test_functional_models.py
+++ b/astropy/modeling/tests/test_functional_models.py
@@ -462,6 +462,7 @@ def test_Ring2D_rout():
         models.Ring2D(amplitude=1, x_0=1, y_0=1, r_in=3, r_out=11, width=7)
 
 
+@pytest.mark.xfail(reason="Failure on MIPS")
 @pytest.mark.skipif(not HAS_SCIPY, reason="requires scipy")
 @pytest.mark.parametrize("fitter", fitters)
 def test_Voigt1D(fitter):
@@ -480,6 +481,7 @@ def test_Voigt1D(fitter):
         models.Voigt1D(method="test")
 
 
+@pytest.mark.xfail(reason="Failure on MIPS")
 @pytest.mark.skipif(not HAS_SCIPY, reason="requires scipy")
 @pytest.mark.parametrize("algorithm", ("humlicek2", "wofz"))
 def test_Voigt1D_norm(algorithm):
@@ -508,6 +510,7 @@ def test_Voigt1D_norm(algorithm):
     assert_allclose(quad(voi, -np.inf, np.inf)[0], 1.0, atol=atol)
 
 
+@pytest.mark.xfail(reason="Failure on MIPS")
 @pytest.mark.skipif(not HAS_SCIPY, reason="requires scipy")
 @pytest.mark.parametrize("doppler", (1.0e-3, 1.0e-2, 0.1, 0.5, 1.0, 2.5, 5.0, 10))
 @pytest.mark.filterwarnings(r"ignore:humlicek2 has been deprecated since .*")
diff --git a/astropy/modeling/tests/test_models.py b/astropy/modeling/tests/test_models.py
index 7e7fbcf..7f41409 100644
--- a/astropy/modeling/tests/test_models.py
+++ b/astropy/modeling/tests/test_models.py
@@ -449,6 +449,7 @@ class Fittable1DModelTester:
         model(self.x1)
         model(self.x2)
 
+    @pytest.mark.xfail(reason="Failure on MIPS")
     def test_eval1D(self, model_class, test_parameters):
         """
         Test model values at certain given points
@@ -705,6 +706,7 @@ def test_ScaleModel():
     assert_equal(m([1, 2], model_set_axis=False), [[42, 84], [43, 86]])
 
 
+@pytest.mark.xfail(reason="Failure on MIPS")
 @pytest.mark.filterwarnings(r"ignore:humlicek2 has been deprecated since .*")
 def test_voigt_model():
     """
diff --git a/astropy/modeling/tests/test_models_quantities.py b/astropy/modeling/tests/test_models_quantities.py
index ac12b53..339c688 100644
--- a/astropy/modeling/tests/test_models_quantities.py
+++ b/astropy/modeling/tests/test_models_quantities.py
@@ -636,6 +636,7 @@ NON_FINITE_DogBox_MODELS = [
 ]
 
 
+@pytest.mark.xfail(reason="Failure on MIPS")
 @pytest.mark.parametrize("model", MODELS)
 @pytest.mark.filterwarnings(r"ignore:humlicek2 has been deprecated since .*")
 def test_models_evaluate_without_units(model):
@@ -654,6 +655,7 @@ def test_models_evaluate_without_units(model):
         assert_quantity_allclose(mnu(*args[:-1]), args[-1])
 
 
+@pytest.mark.xfail(reason="Failure on MIPS")
 @pytest.mark.parametrize("model", MODELS)
 @pytest.mark.filterwarnings(r"ignore:humlicek2 has been deprecated since .*")
 def test_models_evaluate_with_units(model):
@@ -664,6 +666,7 @@ def test_models_evaluate_with_units(model):
         assert_quantity_allclose(m(*args[:-1]), args[-1])
 
 
+@pytest.mark.xfail(reason="Failure on MIPS")
 @pytest.mark.parametrize("model", MODELS)
 @pytest.mark.filterwarnings(r"ignore:humlicek2 has been deprecated since .*")
 def test_models_evaluate_with_units_x_array(model):
@@ -686,6 +689,7 @@ def test_models_evaluate_with_units_x_array(model):
             assert_quantity_allclose(result, u.Quantity([z, z]))
 
 
+@pytest.mark.xfail(reason="Failure on MIPS")
 @pytest.mark.parametrize("model", MODELS)
 @pytest.mark.filterwarnings(r"ignore:humlicek2 has been deprecated since .*")
 def test_models_evaluate_with_units_param_array(model):
diff --git a/astropy/timeseries/periodograms/lombscargle_multiband/tests/test_lombscargle_multiband.py b/astropy/timeseries/periodograms/lombscargle_multiband/tests/test_lombscargle_multiband.py
index f57a772..faa5990 100644
--- a/astropy/timeseries/periodograms/lombscargle_multiband/tests/test_lombscargle_multiband.py
+++ b/astropy/timeseries/periodograms/lombscargle_multiband/tests/test_lombscargle_multiband.py
@@ -300,6 +300,7 @@ def test_errors_on_unit_mismatch(method, data):
 
 @pytest.mark.parametrize("method", ALL_METHODS)
 @pytest.mark.parametrize("with_error", [True, False])
+@pytest.mark.xfail(reason="Failure on MIPS")
 def test_unit_conversions(data, method, with_error):
     t, y, band, dy = data
 
diff --git a/astropy/units/tests/test_quantity_ufuncs.py b/astropy/units/tests/test_quantity_ufuncs.py
index c728186..9050e51 100644
--- a/astropy/units/tests/test_quantity_ufuncs.py
+++ b/astropy/units/tests/test_quantity_ufuncs.py
@@ -629,7 +629,7 @@ class TestQuantityMathFuncs:
     def test_exp_scalar(self, function):
         q = function(3.0 * u.m / (6.0 * u.m))
         assert q.unit == u.dimensionless_unscaled
-        assert q.value == function(0.5)
+        assert np.allclose(q.value, function(0.5), rtol=1e-5)
 
     @pytest.mark.parametrize(
         "function", (np.exp, np.expm1, np.exp2, np.log, np.log2, np.log10, np.log1p)
@@ -637,7 +637,7 @@ class TestQuantityMathFuncs:
     def test_exp_array(self, function):
         q = function(np.array([2.0, 3.0, 6.0]) * u.m / (6.0 * u.m))
         assert q.unit == u.dimensionless_unscaled
-        assert np.all(q.value == function(np.array([1.0 / 3.0, 1.0 / 2.0, 1.0])))
+        assert np.allclose(q.value, function(np.array([1.0 / 3.0, 1.0 / 2.0, 1.0])))
         # should also work on quantities that can be made dimensionless
         q2 = function(np.array([2.0, 3.0, 6.0]) * u.m / (6.0 * u.cm))
         assert q2.unit == u.dimensionless_unscaled
diff --git a/astropy/visualization/wcsaxes/tests/test_misc.py b/astropy/visualization/wcsaxes/tests/test_misc.py
index 527b60e..35e07d5 100644
--- a/astropy/visualization/wcsaxes/tests/test_misc.py
+++ b/astropy/visualization/wcsaxes/tests/test_misc.py
@@ -607,6 +607,7 @@ def test_multiple_draws_grid_contours(tmp_path):
     fig.savefig(tmp_path / "plot.png")
 
 
+@pytest.mark.xfail(reason="Failure on MIPS")
 def test_get_coord_range_nan_regression():
     # Test to make sure there is no internal casting of NaN to integers
     # NumPy 1.24 raises a RuntimeWarning if a NaN is cast to an integer