Package: pyresample Version: 1.2.5-1 Severity: important Tags: sid + patch Justification: FTBFS User: debian-m...@lists.debian.org Usertags: mips-patch Forwarded: https://github.com/pytroll/pyresample/issues/43
Hi, Package pyresample FTBFS on mips* with following error: > ====================================================================== > FAIL: test_custom_uncert (pyresample.test.test_kd_tree.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/«PKGBUILDDIR»/pyresample/test/test_kd_tree.py", line 102, in > test_custom_uncert > len(w) != 1, 'Failed to create neighbour warning') > AssertionError: Failed to create neighbour warning > > ====================================================================== > FAIL: test_gauss_uncert (pyresample.test.test_kd_tree.Test) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/«PKGBUILDDIR»/pyresample/test/test_kd_tree.py", line 79, in > test_gauss_uncert > len(w) != 1, 'Failed to create neighbour warning') > AssertionError: Failed to create neighbour warning > > ---------------------------------------------------------------------- > Ran 115 tests in 582.910s > > FAILED (failures=2) build logs: https://buildd.debian.org/status/fetch.php?pkg=pyresample&arch=mipsel&ver=1.2.5-1&stamp=1470596543 Tests are failing because there are more warnings than expected on mips*. With added debug prints the following warnings are raised: > DBG: test_custom_uncert w[0] = {message : UserWarning('Searching for 8 > neighbours in 3 data points',), category : 'UserWarning', filename : > '/build/pyresample-X1AqqR/pyresample-1.2.5/pyresample/kd_tree.py', lineno : > 314, line : None} > DBG: test_custom_uncert w[1] = {message : RuntimeWarning('invalid value > encountered in multiply',), category : 'RuntimeWarning', filename : > '/build/pyresample-X1AqqR/pyresample-1.2.5/pyresample/kd_tree.py', lineno : > 834, line : None} > > DBG: test_gauss_uncert w[0] = {message : UserWarning('Searching for 8 > neighbours in 3 data points',), category : 'UserWarn>ing', filename : > '/build/pyresample-X1AqqR/pyresample-1.2.5/pyresample/kd_tree.py', lineno : > 314, line : None} > DBG: test_gauss_uncert w[1] = {message : RuntimeWarning('invalid value > encountered in multiply',), category : 'RuntimeWarning', filename : > '/build/pyresample-X1AqqR/pyresample-1.2.5/pyresample/kd_tree.py', lineno : > 834, line : None} Tests are fixed by changing the asserts to handle more warnings than expected. This solution was proposed upstream. With attached patch I was able to build pyresample successfully for mips*. Thanks, Daniel
--- pyresample-1.2.5.orig/pyresample/test/test_kd_tree.py +++ pyresample-1.2.5/pyresample/test/test_kd_tree.py @@ -75,13 +75,13 @@ class Test(unittest.TestCase): res, stddev, count = kd_tree.resample_gauss(self.tswath, self.tdata, self.tgrid, 100000, sigma, with_uncert=True) - self.assertFalse( - len(w) != 1, 'Failed to create neighbour warning') - self.assertFalse(('Searching' not in str( - w[0].message)), 'Failed to create correct neighbour warning') + self.assertTrue( + len(w) > 0, 'Failed to create neighbour warning') + self.assertTrue((any('Searching' in str(_w.message) for _w in w)), + 'Failed to create correct neighbour warning') expected_res = 2.20206560694 - expected_stddev = 0.707115076173 + exprcted_stddev = 0.707115076173 expected_count = 3 self.assertAlmostEqual(res[0], expected_res, 5, 'Failed to calculate gaussian weighting with uncertainty') @@ -98,10 +98,10 @@ class Test(unittest.TestCase): res, stddev, counts = kd_tree.resample_custom(self.tswath, self.tdata, self.tgrid, 100000, wf, with_uncert=True) - self.assertFalse( - len(w) != 1, 'Failed to create neighbour warning') - self.assertFalse(('Searching' not in str( - w[0].message)), 'Failed to create correct neighbour warning') + self.assertTrue( + len(w) > 0, 'Failed to create neighbour warning') + self.assertTrue((any('Searching' in str(_w.message) for _w in w)), + 'Failed to create correct neighbour warning') self.assertAlmostEqual(res[0], 2.32193149, 5, 'Failed to calculate custom weighting with uncertainty')