From 2970a2575db1b801b2a6da9371b45a57275fb433 Mon Sep 17 00:00:00 2001 From: Saran Tunyasuvunakool Date: Thu, 19 Oct 2023 08:26:25 -0700 Subject: [PATCH] Change `assertTrue` to `np.testing.assert_array_less`. This gives a more informative error message on failure, e.g. in https://github.com/conda-forge/mujoco-feedstock/pull/31#issuecomment-1770195171 PiperOrigin-RevId: 574879703 Change-Id: I1936c16264b00d6f80c4817d982b0ab4ab6d4b5d --- mjx/mujoco/mjx/_src/collision_driver_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mjx/mujoco/mjx/_src/collision_driver_test.py b/mjx/mujoco/mjx/_src/collision_driver_test.py index 14e14fb7..71b7b553 100644 --- a/mjx/mujoco/mjx/_src/collision_driver_test.py +++ b/mjx/mujoco/mjx/_src/collision_driver_test.py @@ -303,7 +303,7 @@ class ConvexTest(absltest.TestCase): c = dx.contact self.assertEqual(c.pos.shape[0], 4) - self.assertTrue((c.dist < 0).all()) + np.testing.assert_array_less(c.dist, 0) np.testing.assert_array_almost_equal(c.pos[:, 2], np.array([0.39] * 4), 2) np.testing.assert_array_almost_equal( c.frame[:, 0, :], np.array([[0.0, 0.0, 1.0]] * 4) @@ -375,7 +375,7 @@ class ConvexTest(absltest.TestCase): # Only one contact point for an edge contact. self.assertLess(c.dist[0], 0) - self.assertTrue((c.dist[1:] > 0).all()) + np.testing.assert_array_less(0, c.dist[1:]) np.testing.assert_array_almost_equal(c.frame[0, 0], np.array([0, 0, 1]))