mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-27 21:38:29 +08:00
Merge pull request #1034 from ahojnnes/label-coverage
Test negative intensities in label2rgb
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user