Skip to content

Commit bbe5678

Browse files
committed
Ensure subTest arguments are strings.
pytest-xdist chokes on the error messages otherwise, causing the test to fail.
1 parent a5b2713 commit bbe5678

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_dipoleFitter.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,29 +187,29 @@ def _checkTaskOutput(self, dipoleTestImage, sources, noPreImages=False):
187187
# self.assertFloatsAlmostEqual(record['ip_diffim_DipoleFit_instFluxErr'],
188188
# ???, rtol=rtol)
189189
# emperical uncertainty values: not clear how to compute proper expected values.
190-
with self.subTest(i=i, type="pos_xErr"):
190+
with self.subTest(i=repr(i), type="pos_xErr"):
191191
self.assertFloatsAlmostEqual(record['ip_diffim_DipoleFit_pos_xErr'],
192192
.53*record["base_SdssCentroid_xErr"],
193193
rtol=0.1 if not noPreImages else 0.5)
194-
with self.subTest(i=i, type="pos_yErr"):
194+
with self.subTest(i=repr(i), type="pos_yErr"):
195195
self.assertFloatsAlmostEqual(record['ip_diffim_DipoleFit_pos_yErr'],
196196
.53*record["base_SdssCentroid_yErr"],
197197
rtol=0.1 if not noPreImages else 0.5)
198-
with self.subTest(i=i, type="neg_xErr"):
198+
with self.subTest(i=repr(i), type="neg_xErr"):
199199
self.assertFloatsAlmostEqual(record['ip_diffim_DipoleFit_neg_xErr'],
200200
.53*record["base_SdssCentroid_xErr"],
201201
rtol=0.1 if not noPreImages else 0.5)
202-
with self.subTest(i=i, type="neg_yErr"):
202+
with self.subTest(i=repr(i), type="neg_yErr"):
203203
self.assertFloatsAlmostEqual(record['ip_diffim_DipoleFit_neg_yErr'],
204204
.53*record["base_SdssCentroid_yErr"],
205205
rtol=0.1 if not noPreImages else 0.5)
206206
# NOTE: these are smaller than the positive/negative uncertainties,
207207
# because the of those covariance is negative!
208-
with self.subTest(i=i, type="xErr"):
208+
with self.subTest(i=repr(i), type="xErr"):
209209
self.assertFloatsAlmostEqual(record['ip_diffim_DipoleFit_xErr'],
210210
.34*record["base_SdssCentroid_xErr"],
211211
rtol=0.06 if not noPreImages else 0.5)
212-
with self.subTest(i=i, type="yErr"):
212+
with self.subTest(i=repr(i), type="yErr"):
213213
self.assertFloatsAlmostEqual(record['ip_diffim_DipoleFit_yErr'],
214214
.35*record["base_SdssCentroid_yErr"],
215215
rtol=0.06 if not noPreImages else 0.5)

0 commit comments

Comments
 (0)