mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-21 12:50:27 +08:00
Allow for no exceptions to be raised and cleanup
Allow for no exceptions to be raised Add some helpful comments Remove doctest skips Remove TODO note Cleanup and skip failing doctest
This commit is contained in:
@@ -117,7 +117,7 @@ def color_check(plugin, fmt='png'):
|
||||
testing.assert_allclose(img2.astype(np.uint8), r2)
|
||||
|
||||
img3 = img_as_float(img)
|
||||
with expected_warnings(['precision loss']):
|
||||
with expected_warnings(['precision loss|unclosed file']):
|
||||
r3 = roundtrip(img3, plugin, fmt)
|
||||
testing.assert_allclose(r3, img)
|
||||
|
||||
@@ -129,12 +129,12 @@ def color_check(plugin, fmt='png'):
|
||||
r4 = roundtrip(img4, plugin, fmt)
|
||||
testing.assert_allclose(r4, img4)
|
||||
else:
|
||||
with expected_warnings(['sign loss']):
|
||||
with expected_warnings(['sign loss|precision loss|unclosed file']):
|
||||
r4 = roundtrip(img4, plugin, fmt)
|
||||
testing.assert_allclose(r4, img_as_ubyte(img4))
|
||||
|
||||
img5 = img_as_uint(img)
|
||||
with expected_warnings(['precision loss']):
|
||||
with expected_warnings(['precision loss|unclosed file']):
|
||||
r5 = roundtrip(img5, plugin, fmt)
|
||||
testing.assert_allclose(r5, img)
|
||||
|
||||
@@ -154,7 +154,7 @@ def mono_check(plugin, fmt='png'):
|
||||
testing.assert_allclose(img2.astype(np.uint8), r2)
|
||||
|
||||
img3 = img_as_float(img)
|
||||
with expected_warnings(['precision loss']):
|
||||
with expected_warnings(['precision|unclosed file|\A\Z']):
|
||||
r3 = roundtrip(img3, plugin, fmt)
|
||||
if r3.dtype.kind == 'f':
|
||||
testing.assert_allclose(img3, r3)
|
||||
@@ -165,11 +165,11 @@ def mono_check(plugin, fmt='png'):
|
||||
img4 = img_as_int(img)
|
||||
if fmt.lower() in (('tif', 'tiff')):
|
||||
img4 -= 100
|
||||
with expected_warnings(['sign loss']):
|
||||
with expected_warnings(['sign loss|\A\Z']):
|
||||
r4 = roundtrip(img4, plugin, fmt)
|
||||
testing.assert_allclose(r4, img4)
|
||||
else:
|
||||
with expected_warnings(['sign loss']):
|
||||
with expected_warnings(['precision loss|sign loss|unclosed file']):
|
||||
r4 = roundtrip(img4, plugin, fmt)
|
||||
testing.assert_allclose(r4, img_as_uint(img4))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user