From 1cc3ea85556c8db762b4331ab4a31cdfc0a06c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 1 Jan 2026 20:18:29 +0100 Subject: [PATCH] python: do more fuzzy comparisons for floats. The new CircleCI macOS VM produces values that don't compare equal anymore. --- src/python/magnum/test/test_math.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/magnum/test/test_math.py b/src/python/magnum/test/test_math.py index 138ad28..d515f8e 100644 --- a/src/python/magnum/test/test_math.py +++ b/src/python/magnum/test/test_math.py @@ -1492,8 +1492,8 @@ Matrix\\(2, 0, 0, self.assertAlmostEqual(float(Deg(a.angle())), float(Deg(45.0)), 4) self.assertEqual(a.axis(), Vector3.x_axis()) self.assertEqual(a.to_matrix(), Matrix4.rotation_x(Deg(45.0)).rotation_scaling()) - self.assertEqual(a.dot(), 1.0) - self.assertEqual(a.length(), 1.0) + self.assertAlmostEqual(a.dot(), 1.0, 6) + self.assertAlmostEqual(a.length(), 1.0, 6) self.assertEqual(a.conjugated(), Quaternion((-0.382683, 0.0, 0.0), 0.92388)) self.assertEqual(a.inverted(), Quaternion.rotation(Deg(45.0), -Vector3.x_axis())) self.assertEqual(a.inverted_normalized(), Quaternion.rotation(Deg(45.0), -Vector3.x_axis())) @@ -1518,7 +1518,7 @@ Matrix\\(2, 0, 0, def test_functions(self): a = Quaternion.rotation(Deg(45.0), Vector3d.x_axis()) b = Quaternion.rotation(Deg(-145.0), Vector3d.x_axis()) - self.assertEqual(math.dot(a, b), -0.08715575933456421) + self.assertAlmostEqual(math.dot(a, b), -0.08715575933456421) self.assertEqual(Deg(math.half_angle(a, b)), Deg(95.000001505251)) self.assertEqual(math.lerp(a, b, 0.25), Quaternion((0.0631263, 0.0, 0.0), 0.998006)) self.assertEqual(math.lerp_shortest_path(a, b, 0.25), Quaternion((-0.647912, 0.0, 0.0), -0.761715))