mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-30 12:31:08 +08:00
Add test that error gets raised when no plugin available
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user