Skip to content

Commit eebde3e

Browse files
committed
Fix probabilistic ending tournament tests
1 parent 93ad966 commit eebde3e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

axelrod/match_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def build_single_match_params(self):
123123
Creates a single set of match parameters.
124124
"""
125125
return (
126-
self.sample_length(self.prob_end), self.game, None, self.noise,
126+
self.sample_length(), self.game, None, self.noise,
127127
{'length': float('inf'), 'game': self.game, 'noise': self.noise})
128128

129129
def sample_length(self):

axelrod/tests/unit/test_match_generator.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,13 @@ def test_build_matches_different_length(self, prob_end):
153153
@given(prob_end=floats(min_value=0, max_value=1))
154154
def test_sample_length(self, prob_end):
155155
rr = axelrod.ProbEndRoundRobinMatches(
156-
self.players, prob_end, test_game, test_repetitions)
157-
self.assertGreaterEqual(rr.sample_length(prob_end), 1)
156+
self.players, prob_end, test_game, test_repetitions,
157+
)
158+
self.assertGreaterEqual(rr.sample_length(), 1)
158159
try:
159-
self.assertIsInstance(rr.sample_length(prob_end), int)
160+
self.assertIsInstance(rr.sample_length(), int)
160161
except AssertionError:
161-
self.assertEqual(rr.sample_length(prob_end), float("inf"))
162+
self.assertEqual(rr.sample_length(), float("inf"))
162163

163164
@given(prob_end=floats(min_value=.1, max_value=1))
164165
def test_build_single_match_params(self, prob_end):
@@ -300,11 +301,11 @@ def test_sample_length(self, prob_end):
300301
noise = 0
301302
pesp = axelrod.ProbEndSpatialMatches(
302303
self.players, prob_end, test_game, test_repetitions, noise, edges)
303-
self.assertGreaterEqual(pesp.sample_length(prob_end), 1)
304+
self.assertGreaterEqual(pesp.sample_length(), 1)
304305
try:
305-
self.assertIsInstance(pesp.sample_length(prob_end), int)
306+
self.assertIsInstance(pesp.sample_length(), int)
306307
except AssertionError:
307-
self.assertEqual(pesp.sample_length(prob_end), float("inf"))
308+
self.assertEqual(pesp.sample_length(), float("inf"))
308309

309310
@given(prob_end=floats(min_value=0.005, max_value=0.01))
310311
def test_build_matches_different_length(self, prob_end):

0 commit comments

Comments
 (0)