Description of problem: During an unrelated coordinated Rawhide rebuild, I've noticed python2.7 and python3.6 fail to build on i686 with a precision-related? bug: ====================================================================== FAIL: test_distance (test.test_turtle.TestVec2D) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-2.7.18/Lib/test/test_turtle.py", line 220, in test_distance self.assertEqual(abs(vec), expected) AssertionError: 9.999999999999998 != 10 ---------------------------------------------------------------------- ====================================================================== FAIL: test_distance (test.test_turtle.TestVec2D) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.6.15/Lib/test/test_turtle.py", line 223, in test_distance self.assertEqual(abs(vec), expected) AssertionError: 9.999999999999998 != 10 ---------------------------------------------------------------------- Funnily enough, at least python3.6 succeeds on armv7hl. python2.7: https://koji.fedoraproject.org/koji/taskinfo?taskID=80997420 python3.6: https://koji.fedoraproject.org/koji/taskinfo?taskID=80997409
Looks like these should use assertAlmostEqual (even in the newer versions, if it's not the case there). https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertAlmostEqual
Right, Python 3.11 uses assertAlmostEqual() since July 2021 (it's a recent change): def test_distance(self): self.assertEqual(abs(Vec2D(6, 8)), 10) self.assertEqual(abs(Vec2D(0, 0)), 0) self.assertAlmostEqual(abs(Vec2D(2.5, 6)), 6.5) See: * https://github.com/python/cpython/commit/3f135c073a53793ec68902f6b513934ddff47235 * https://bugs.python.org/issue44734
Downstream PR's to the affected Python version: https://src.fedoraproject.org/rpms/python2.7/pull-request/24 https://src.fedoraproject.org/rpms/python3.6/pull-request/38 Fedora-Python patch PR's: https://github.com/fedora-python/cpython/pull/29 https://github.com/fedora-python/cpython/pull/28
FEDORA-2022-b0c84e7430 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b0c84e7430
FEDORA-2022-b0c84e7430 has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2022-dce85ff0dc has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-dce85ff0dc
FEDORA-2022-dce85ff0dc has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report.