From 397e7c1adea63e121f9129a7f44d5fbc1c9f75c2 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Fri, 28 Jun 2013 16:08:11 -0500 Subject: [PATCH] Clean up test. --- skimage/io/tests/test_io.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/skimage/io/tests/test_io.py b/skimage/io/tests/test_io.py index 5fa3e14a..6643e82e 100644 --- a/skimage/io/tests/test_io.py +++ b/skimage/io/tests/test_io.py @@ -28,8 +28,10 @@ def test_imread_url(): image = io.imread(image_url) assert image.shape == (512, 512) + def test_imsave_filelike(): - image = np.array([[0, 0], [0, 0]], dtype=float) + shape = (2, 2) + image = np.zeros(shape) s = StringIO() # save to file-like object @@ -37,8 +39,10 @@ def test_imsave_filelike(): # read from file-like object s.seek(0) - image = io.imread(s) - assert image.shape == (2, 2) + out = io.imread(s) + assert out.shape == shape + np.testing.assert_allclose(out, image) + if __name__ == "__main__": run_module_suite()