From 337f3d175f42b2951d1c3d47ee9f7df7b8c86db1 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Sun, 27 Apr 2014 02:10:29 +0200 Subject: [PATCH] Update shape tests to use all_warnings --- skimage/util/tests/test_shape.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/skimage/util/tests/test_shape.py b/skimage/util/tests/test_shape.py index 7a5640a3..8f4c4291 100644 --- a/skimage/util/tests/test_shape.py +++ b/skimage/util/tests/test_shape.py @@ -3,6 +3,7 @@ from nose.tools import raises from numpy.testing import assert_equal, assert_warns from skimage.util.shape import view_as_blocks, view_as_windows +from skimage.util import all_warnings @raises(TypeError) @@ -132,7 +133,7 @@ def test_view_as_windows_2D(): [17, 18, 19]]]])) -def test_view_as_windows_With_skip(): +def test_view_as_windows_with_skip(): A = np.arange(20).reshape((5, 4)) B = view_as_windows(A, (2, 2), step=2) assert_equal(B, [[[[0, 1], @@ -152,8 +153,9 @@ def test_views_non_contiguous(): A = np.arange(16).reshape((4, 4)) A = A[::2, :] - assert_warns(RuntimeWarning, view_as_blocks, A, (2, 2)) - assert_warns(RuntimeWarning, view_as_windows, A, (2, 2)) + with all_warnings(): + assert_warns(RuntimeWarning, view_as_blocks, A, (2, 2)) + assert_warns(RuntimeWarning, view_as_windows, A, (2, 2)) if __name__ == '__main__':