mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-27 11:27:08 +08:00
Test type warning from remove_small_objects
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user