From 5f067ff43b79d430458b517d229e5235c1734dcb Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 9 May 2015 10:22:48 -0500 Subject: [PATCH] Move tests to pil plugin and fix file path --- skimage/io/tests/test_imread.py | 20 -------------------- skimage/io/tests/test_pil.py | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/skimage/io/tests/test_imread.py b/skimage/io/tests/test_imread.py index be6e4d32..9f045d12 100644 --- a/skimage/io/tests/test_imread.py +++ b/skimage/io/tests/test_imread.py @@ -61,26 +61,6 @@ def test_bilevel(): assert_array_equal(img.astype(bool), expected) -@skipif(not imread_available) -def test_imread_separate_channels(): - # Test that imread returns RGBA values contiguously even when they are - # stored in separate planes. - x = np.random.rand(3, 16, 8) - f = NamedTemporaryFile(suffix='.tif') - fname = f.name - f.close() - imsave(fname, x) - img = imread(fname) - os.remove(fname) - assert img.shape == (16, 8, 3), img.shape - - -@skipif(not imread_available) -def test_imread_multipage_rgb_tif(): - img = imread(os.path.join(data_dir, 'multipage_rgb.png')) - assert img.shape == (10, 10, 3), img.shape - - class TestSave: def roundtrip(self, x, scaling=1): f = NamedTemporaryFile(suffix='.png') diff --git a/skimage/io/tests/test_pil.py b/skimage/io/tests/test_pil.py index 77957053..1ac184a2 100644 --- a/skimage/io/tests/test_pil.py +++ b/skimage/io/tests/test_pil.py @@ -50,6 +50,24 @@ def test_imread_flatten(): assert np.sctype2char(img.dtype) in np.typecodes['AllInteger'] +def test_imread_separate_channels(): + # Test that imread returns RGBA values contiguously even when they are + # stored in separate planes. + x = np.random.rand(3, 16, 8) + f = NamedTemporaryFile(suffix='.tif') + fname = f.name + f.close() + imsave(fname, x) + img = imread(fname) + os.remove(fname) + assert img.shape == (16, 8, 3), img.shape + + +def test_imread_multipage_rgb_tif(): + img = imread(os.path.join(data_dir, 'multipage_rgb.tif')) + assert img.shape == (10, 10, 3), img.shape + + def test_imread_palette(): img = imread(os.path.join(data_dir, 'palette_gray.png')) assert img.ndim == 2