From a423bd15e6cdb416ee721bb9df1e31992dc37066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Boulogne?= Date: Sat, 15 Mar 2014 07:58:01 -0400 Subject: [PATCH] MAINT: use asset_allclose instead of round --- skimage/draw/tests/test_draw3d.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/skimage/draw/tests/test_draw3d.py b/skimage/draw/tests/test_draw3d.py index f529718a..a455e947 100644 --- a/skimage/draw/tests/test_draw3d.py +++ b/skimage/draw/tests/test_draw3d.py @@ -102,18 +102,18 @@ def test_ellipsoid_levelset(): def test_ellipsoid_stats(): # Test comparison values generated by Wolfram Alpha vol, surf = ellipsoid_stats(6, 10, 16) - assert(round(1280 * np.pi, 4) == round(vol, 4)) - assert(1383.28 == round(surf, 2)) + assert_allclose(1280 * np.pi, vol, atol=1e-4) + assert_allclose(1383.28, surf, atol=1e-2) # Test when a <= b <= c does not hold vol, surf = ellipsoid_stats(16, 6, 10) - assert(round(1280 * np.pi, 4) == round(vol, 4)) - assert(1383.28 == round(surf, 2)) + assert_allclose(1280 * np.pi, vol, atol=1e-4)) + assert_allclose(1383.28, surf, atol=1e-2) # Larger test to ensure reliability over broad range vol, surf = ellipsoid_stats(17, 27, 169) - assert(round(103428 * np.pi, 4) == round(vol, 4)) - assert(37426.3 == round(surf, 1)) + assert_allclose(103428 * np.pi, vol, atol=1e-4)) + assert_allclose(37426.3, surf, atol=1e-1) if __name__ == "__main__":