From dad16f8a29d92ebeab2be5ccc503a9657826b2b3 Mon Sep 17 00:00:00 2001 From: cgohlke Date: Wed, 23 May 2012 11:33:19 -0700 Subject: [PATCH] Restore test_float_out_of_range --- skimage/util/tests/test_dtype.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/skimage/util/tests/test_dtype.py b/skimage/util/tests/test_dtype.py index 9597c784..2ef0044f 100644 --- a/skimage/util/tests/test_dtype.py +++ b/skimage/util/tests/test_dtype.py @@ -69,6 +69,13 @@ def test_unsupported_dtype(): assert_raises(ValueError, img_as_int, x) +def test_float_out_of_range(): + too_high = np.array([2], dtype=np.float32) + assert_raises(ValueError, img_as_int, too_high) + too_low = np.array([-2], dtype=np.float32) + assert_raises(ValueError, img_as_int, too_low) + + def test_copy(): x = np.array([1], dtype=np.float64) y = img_as_float(x)