From e751d245f372cf8a69ef155f45cffb6557fb8efb Mon Sep 17 00:00:00 2001 From: emmanuelle Date: Sun, 10 May 2015 23:29:54 +0200 Subject: [PATCH] Modified test with a less stringent condition on numerical value for the mean value of blobs image. --- skimage/data/tests/test_data.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/skimage/data/tests/test_data.py b/skimage/data/tests/test_data.py index a4afb056..ce9b5879 100644 --- a/skimage/data/tests/test_data.py +++ b/skimage/data/tests/test_data.py @@ -1,6 +1,6 @@ import numpy as np import skimage.data as data -from numpy.testing import assert_equal +from numpy.testing import assert_equal, assert_almost_equal def test_lena(): @@ -58,11 +58,11 @@ def test_coffee(): def test_binary_blobs(): blobs = data.binary_blobs(length=128) - assert blobs.mean() == 0.5 + assert_almost_equal(blobs.mean(), 0.5, decimal=4) blobs = data.binary_blobs(length=128, volume_fraction=0.25) - assert blobs.mean() == 0.25 + assert_almost_equal(blobs.mean(), 0.25, decimal=4) blobs = data.binary_blobs(length=32, volume_fraction=0.25, n_dim=3) - assert blobs.mean() == 0.25 + assert_almost_equal(blobs.mean(), 0.25, decimal=4) other_realization = data.binary_blobs(length=32, volume_fraction=0.25, n_dim=3) assert not np.all(blobs == other_realization)