From 1fbed8a8d0e8d0d2cd39ba01b67ba007e929a869 Mon Sep 17 00:00:00 2001 From: Pietro Berkes Date: Tue, 1 Apr 2014 21:10:04 +0100 Subject: [PATCH] Fix random seed for test stability. --- skimage/feature/tests/test_texture.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/skimage/feature/tests/test_texture.py b/skimage/feature/tests/test_texture.py index 9ed15d4c..00900645 100644 --- a/skimage/feature/tests/test_texture.py +++ b/skimage/feature/tests/test_texture.py @@ -184,8 +184,13 @@ class TestLBP(): def test_var(self): # Test idea: mean of variance is estimate of overall variance. - target_std = 0.3 + + # Fix random seed for test stability. + np.random.seed(13141516) + + # Create random image with known variance. image = np.random.random((500, 500)) + target_std = 0.3 image = image / image.std() * target_std # Use P=4 to avoid interpolation effects