@@ -217,19 +217,27 @@ def setUpClass(cls):
217
217
cls .players = [s () for s in test_strategies ]
218
218
219
219
@given (repetitions = integers (min_value = 1 , max_value = test_repetitions ),
220
- turns = integers (min_value = 1 , max_value = test_turns ))
221
- @example (repetitions = test_repetitions , turns = test_turns )
222
- def test_build_match_chunks (self , repetitions , turns ):
220
+ turns = integers (min_value = 1 , max_value = test_turns ),
221
+ noise = floats (min_value = 0 , max_value = 1 ))
222
+ @example (repetitions = test_repetitions , turns = test_turns , noise = 0 )
223
+ def test_build_match_chunks (self , repetitions , turns , noise ):
223
224
edges = [(0 , 1 ), (1 , 2 ), (3 , 4 )]
224
225
sp = axelrod .SpatialMatches (
225
- self .players , turns , test_game , repetitions , edges )
226
+ self .players , turns , test_game , repetitions , edges , noise )
226
227
chunks = list (sp .build_match_chunks ())
227
- match_definitions = [tuple (list (index_pair ) + [repetitions ])
228
- for (index_pair , match_params , repetitions ) in chunks ]
229
- expected_match_definitions = [(edge [0 ], edge [1 ], repetitions )
230
- for edge in edges ]
231
228
232
- self .assertEqual (sorted (match_definitions ), sorted (expected_match_definitions ))
229
+ match_definitions = set ()
230
+
231
+ cache = None
232
+ expected_params = (turns , test_game , cache , noise )
233
+ for index_pair , match_params , repetitions in chunks :
234
+ match_definitions .add (tuple (list (index_pair ) + [repetitions ]))
235
+ self .assertEqual (match_params , expected_params )
236
+
237
+ expected_match_definitions = set ((edge [0 ], edge [1 ], repetitions )
238
+ for edge in edges )
239
+
240
+ self .assertEqual (match_definitions , expected_match_definitions )
233
241
234
242
def test_len (self ):
235
243
edges = [(0 , 1 ), (1 , 2 ), (3 , 4 )]
0 commit comments