diff --git a/skimage/io/tests/test_null.py b/skimage/io/tests/test_null.py new file mode 100644 index 00000000..6d3913d9 --- /dev/null +++ b/skimage/io/tests/test_null.py @@ -0,0 +1,35 @@ +import os +import warnings + +import numpy as np +from numpy.testing import raises + +from skimage import io +from skimage import data_dir + + +@raises(Warning) +def test_null_imread(): + path = os.path.join(data_dir, 'color.png') + with warnings.catch_warnings(): # Temporarily set warnings as errors. + warnings.filterwarnings('error') + io.imread(path, plugin='null') + + +@raises(Warning) +def test_null_imsave(): + with warnings.catch_warnings(): # Temporarily set warnings as errors. + warnings.filterwarnings('error') + io.imsave('dummy.png', np.zeros((3, 3)), plugin='null') + + +@raises(Warning) +def test_null_imshow(): + with warnings.catch_warnings(): # Temporarily set warnings as errors. + warnings.filterwarnings('error') + io.imshow(np.zeros((3, 3)), plugin='null') + + +if __name__ == '__main__': + from numpy.testing import run_module_suite + run_module_suite()