Add test that error gets raised when no plugin available

This commit is contained in:
Tony S Yu
2013-12-05 23:19:45 -06:00
parent 86abc7c970
commit 318781bca1
+9
View File
@@ -4,6 +4,7 @@ from numpy.testing import assert_array_equal, raises, run_module_suite
import numpy as np
import skimage.io as io
from skimage.io._plugins.plugin import plugin_store
from skimage import data_dir
@@ -28,5 +29,13 @@ def test_imread_url():
assert image.shape == (512, 512)
@raises(RuntimeError)
def test_imread_no_plugin():
# tweak data path so that file URI works on both unix and windows.
image_path = os.path.join(data_dir, 'lena.png')
plugin_store['imread'] = []
io.imread(image_path)
if __name__ == "__main__":
run_module_suite()