Merge pull request #1034 from ahojnnes/label-coverage

Test negative intensities in label2rgb
This commit is contained in:
Juan Nunez-Iglesias
2014-06-19 01:57:48 +10:00
+9 -1
View File
@@ -3,8 +3,9 @@ import itertools
import numpy as np
from numpy import testing
from skimage.color.colorlabel import label2rgb
from skimage._shared.utils import all_warnings
from numpy.testing import (assert_array_almost_equal as assert_close,
assert_array_equal)
assert_array_equal, assert_warns)
def test_shape_mismatch():
@@ -123,6 +124,13 @@ def test_avg():
assert_array_equal(out_bg, expected_out_bg)
def test_negative_intensity():
with all_warnings():
labels = np.arange(100).reshape(10, 10)
image = -1 * np.ones((10, 10))
assert_warns(UserWarning, label2rgb, labels, image)
if __name__ == '__main__':
testing.run_module_suite()