Handle more warnings and reset io plugins as needed

Reset plugins prior to running collections test

Handle warnings in morphology pkg

Add __init__ for morpohology tests

Handle warnings for novice pkg

Handle warnings for restoration pkg

Handle warnings for segmentation pkg

Handle warnings for _shared pkg

Handle warnings for transform pkg

Handle warnings for util pkg

Handle warnings in viewer module
This commit is contained in:
Steven Silvester
2014-12-23 16:48:16 -06:00
parent 9e8f91930e
commit 0debedd82c
21 changed files with 161 additions and 75 deletions
+2
View File
@@ -0,0 +1,2 @@
import warnings
warnings.simplefilter('error')
+6 -2
View File
@@ -3,6 +3,7 @@ from numpy.testing import assert_equal, assert_raises
from skimage import img_as_int, img_as_float, \
img_as_uint, img_as_ubyte
from skimage.util.dtype import convert
from skimage._shared.utils import all_warnings
dtype_range = {np.uint8: (0, 255),
@@ -28,7 +29,9 @@ def test_range():
(img_as_float, np.float64),
(img_as_uint, np.uint16),
(img_as_ubyte, np.ubyte)]:
y = f(x)
with all_warnings(): # precision loss
y = f(x)
omin, omax = dtype_range[dt]
@@ -59,7 +62,8 @@ def test_range_extra_dtypes():
for dtype_in, dt in dtype_pairs:
imin, imax = dtype_range_extra[dtype_in]
x = np.linspace(imin, imax, 10).astype(dtype_in)
y = convert(x, dt)
with all_warnings(): # sign loss
y = convert(x, dt)
omin, omax = dtype_range_extra[dt]
yield (_verify_range,
"From %s to %s" % (np.dtype(dtype_in), np.dtype(dt)),