From 03be934e6d4f19d09fe698336fa9722abdf36a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 16 Dec 2014 16:38:01 +0100 Subject: [PATCH] Set seed for test cases --- skimage/restoration/tests/test_unwrap.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/skimage/restoration/tests/test_unwrap.py b/skimage/restoration/tests/test_unwrap.py index 8c2a6487..39723894 100644 --- a/skimage/restoration/tests/test_unwrap.py +++ b/skimage/restoration/tests/test_unwrap.py @@ -37,7 +37,7 @@ def check_unwrap(image, mask=None): print('Testing a masked image') image = np.ma.array(image, mask=mask) image_wrapped = np.ma.array(image_wrapped, mask=mask) - image_unwrapped = unwrap_phase(image_wrapped) + image_unwrapped = unwrap_phase(image_wrapped, seed=0) assert_phase_almost_equal(image_unwrapped, image) @@ -47,7 +47,7 @@ def test_unwrap_1d(): # Masked arrays are not allowed in 1D assert_raises(ValueError, check_unwrap, image, True) # wrap_around is not allowed in 1D - assert_raises(ValueError, unwrap_phase, image, True) + assert_raises(ValueError, unwrap_phase, image, True, seed=0) def test_unwrap_2d(): @@ -83,7 +83,7 @@ def check_wrap_around(ndim, axis): with warnings.catch_warnings(): # We do not want warnings about length 1 dimensions warnings.simplefilter("ignore") - image_unwrap_no_wrap_around = unwrap_phase(image_wrapped) + image_unwrap_no_wrap_around = unwrap_phase(image_wrapped, seed=0) print('endpoints without wrap_around:', image_unwrap_no_wrap_around[index_first], image_unwrap_no_wrap_around[index_last]) @@ -95,7 +95,8 @@ def check_wrap_around(ndim, axis): with warnings.catch_warnings(): # We do not want warnings about length 1 dimensions warnings.simplefilter("ignore") - image_unwrap_wrap_around = unwrap_phase(image_wrapped, wrap_around) + image_unwrap_wrap_around = unwrap_phase(image_wrapped, wrap_around, + seed=0) print('endpoints with wrap_around:', image_unwrap_wrap_around[index_first], image_unwrap_wrap_around[index_last])