diff --git a/skimage/data/__init__.py b/skimage/data/__init__.py index 6dc5dd8e..e0e97d03 100644 --- a/skimage/data/__init__.py +++ b/skimage/data/__init__.py @@ -7,11 +7,13 @@ For more images, see """ import os as _os +import warnings from .. import data_dir from ..io import imread, use_plugin from .._shared.utils import deprecated from ._binary_blobs import binary_blobs +from .. import img_as_bool __all__ = ['load', 'camera', @@ -168,7 +170,9 @@ def horse(): (marauder). """ - return load("horse.png") + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + return img_as_bool(load("horse.png")) def clock(): diff --git a/skimage/data/tests/test_data.py b/skimage/data/tests/test_data.py index e17b2f08..1eaf87cb 100644 --- a/skimage/data/tests/test_data.py +++ b/skimage/data/tests/test_data.py @@ -25,9 +25,35 @@ def test_checkerboard(): data.checkerboard() -def test_text(): - """ Test that "text" image can be loaded. """ - data.text() +def test_chelsea(): + """ Test that "chelsea" image can be loaded. """ + data.chelsea() + + +def test_clock(): + """ Test that "clock" image can be loaded. """ + data.clock() + + +def test_coffee(): + """ Test that "coffee" image can be loaded. """ + data.coffee() + + +def test_horse(): + """ Test that "horse" image can be loaded. """ + horse = data.horse() + assert_equal(horse.dtype, np.dtype('bool')) + + +def test_hubble(): + """ Test that "Hubble" image can be loaded. """ + data.hubble_deep_field() + + +def test_immunohistochemistry(): + """ Test that "immunohistochemistry" image can be loaded. """ + data.immunohistochemistry() def test_moon(): @@ -40,19 +66,14 @@ def test_page(): data.page() -def test_clock(): - """ Test that "clock" image can be loaded. """ - data.clock() +def test_rocket(): + """ Test that "rocket" image can be loaded. """ + data.rocket() -def test_chelsea(): - """ Test that "chelsea" image can be loaded. """ - data.chelsea() - - -def test_coffee(): - """ Test that "coffee" image can be loaded. """ - data.coffee() +def test_text(): + """ Test that "text" image can be loaded. """ + data.text() def test_binary_blobs():