diff --git a/skimage/_shared/testing.py b/skimage/_shared/testing.py index db3bcfe8..f8c7a88e 100644 --- a/skimage/_shared/testing.py +++ b/skimage/_shared/testing.py @@ -100,8 +100,8 @@ def roundtrip(img, plugin, suffix): return new -def ubyte_check(plugin, fmt='png'): - """Check roundtrip behavior for images that can only be saved as uint8 +def color_check(plugin, fmt='png'): + """Check roundtrip behavior for color images. All major input types should be handled as ubytes and read back correctly. @@ -132,11 +132,10 @@ def ubyte_check(plugin, fmt='png'): testing.assert_allclose(r5, img) -def full_range_check(plugin, fmt='png'): +def mono_check(plugin, fmt='png'): """Check the roundtrip behavior for images that support most types. - All major input types should be handled, except bool is treated - as ubyte and float can treated as uint16 or float. + All major input types should be handled. """ img = img_as_ubyte(data.moon()) @@ -169,7 +168,7 @@ def full_range_check(plugin, fmt='png'): if __name__ == '__main__': - ubyte_check('pil') - full_range_check('pil') - ubyte_check('pil', 'bmp') - full_range_check('pil', 'tiff') + color_check('pil') + mono_check('pil') + mono_check('pil', 'bmp') + mono_check('pil', 'tiff') diff --git a/skimage/io/tests/test_pil.py b/skimage/io/tests/test_pil.py index 7b5cdd49..ee9add79 100644 --- a/skimage/io/tests/test_pil.py +++ b/skimage/io/tests/test_pil.py @@ -8,7 +8,7 @@ from tempfile import NamedTemporaryFile from skimage import data_dir from skimage.io import (imread, imsave, use_plugin, reset_plugins, Image as ioImage) -from skimage._shared.testing import ubyte_check, full_range_check +from skimage._shared.testing import mono_check, color_check from six import BytesIO @@ -157,13 +157,13 @@ def test_imexport_imimport(): def test_all_color(): - ubyte_check('pil') - ubyte_check('pil', 'bmp') + color_check('pil') + color_check('pil', 'bmp') def test_all_mono(): - full_range_check('pil') - full_range_check('pil', 'tiff') + mono_check('pil') + mono_check('pil', 'tiff') class TestSaveTIF: