diff --git a/skimage/morphology/tests/test_misc.py b/skimage/morphology/tests/test_misc.py index 94d27f64..8789b22a 100644 --- a/skimage/morphology/tests/test_misc.py +++ b/skimage/morphology/tests/test_misc.py @@ -1,5 +1,6 @@ import numpy as np -from numpy.testing import assert_array_equal, assert_equal, assert_raises +from numpy.testing import (assert_array_equal, assert_equal, assert_raises, + assert_warns) from skimage.morphology import remove_small_objects test_image = np.array([[0, 0, 0, 1, 0], @@ -55,6 +56,13 @@ def test_uint_image(): assert_array_equal(observed, expected) +def test_single_label_warning(): + image = np.array([[0, 0, 0, 1, 0], + [1, 1, 1, 0, 0], + [1, 1, 1, 0, 0]], int) + assert_warns(UserWarning, remove_small_objects, image, min_size=6) + + def test_float_input(): float_test = np.random.rand(5, 5) assert_raises(TypeError, remove_small_objects, float_test)