From 1be2685fa68873ab90d3ad3342954d24b4393732 Mon Sep 17 00:00:00 2001
From: Reimar Leike <reimar@leike.name>
Date: Wed, 18 Jul 2018 13:50:48 +0200
Subject: [PATCH] some tweaks to make test deterministic

---
 test/test_operators/test_adjoint.py | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/test/test_operators/test_adjoint.py b/test/test_operators/test_adjoint.py
index 94bbefbbe..bdbe13de6 100644
--- a/test/test_operators/test_adjoint.py
+++ b/test/test_operators/test_adjoint.py
@@ -39,18 +39,13 @@ class Consistency_Tests(unittest.TestCase):
                         + _pow_spaces,
                     [np.float64, np.complex128]))
     def testDOFDistributor(self, sp, dtype):
+        #TODO: Test for DomainTuple
         if sp.size < 4:
             return
-        N_tries = 10
-        for i in range(N_tries):
-            try:
-                dofdex = np.random.choice(np.arange(3), size=sp.shape)
-                dofdex = ift.Field.from_global_data(sp, dofdex)
-                op = ift.DOFDistributor(dofdex)
-                ift.extra.consistency_check(op, dtype, dtype)
-                return
-            except ValueError:
-                pass
+        dofdex = np.arange(sp.size).reshape(sp.shape)%3
+        dofdex = ift.Field.from_global_data(sp, dofdex)
+        op = ift.DOFDistributor(dofdex)
+        ift.extra.consistency_check(op, dtype, dtype)
 
 
     @expand(product(_h_spaces, [np.float64, np.complex128]))
-- 
GitLab