diff --git a/skimage/io/tests/test_freeimage.py b/skimage/io/tests/test_freeimage.py index 50fef9ee..478a1a90 100644 --- a/skimage/io/tests/test_freeimage.py +++ b/skimage/io/tests/test_freeimage.py @@ -14,6 +14,16 @@ try: except OSError: FI_available = False + +def setup_module(self): + """The effect of the `plugin.use` call may be overridden by later imports. + Call `use_plugin` directly before the tests to ensure that freeimage is + used. + + """ + sio.use_plugin('freeimage') + + @skipif(not FI_available) def test_imread(): img = sio.imread(os.path.join(si.data_dir, 'color.png')) diff --git a/skimage/io/tests/test_pil.py b/skimage/io/tests/test_pil.py index 021c74ea..23c4d933 100644 --- a/skimage/io/tests/test_pil.py +++ b/skimage/io/tests/test_pil.py @@ -18,6 +18,13 @@ else: PIL_available = True +def setup_module(self): + """The effect of the `plugin.use` call may be overridden by later imports. + Call `use_plugin` directly before the tests to ensure that PIL is used. + + """ + use_plugin('pil') + @skipif(not PIL_available) def test_imread_flatten(): # a color image is flattened