Skip to content

Commit d90333b

Browse files
committed
Reduce test size and remove noise.
Because of the sampling we can't test noise in this way.
1 parent 491f3fc commit d90333b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

axelrod/tests/unit/test_tournament.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,11 @@ def test_init(self):
708708
@given(strategies=strategy_lists(strategies=deterministic_strategies,
709709
min_size=2, max_size=2),
710710
prob_end=floats(min_value=.1, max_value=.9),
711+
reps=integers(min_value=1, max_value=3),
711712
seed=integers(min_value=0, max_value=4294967295))
712-
def test_complete_tournament(self, strategies, prob_end, seed):
713+
@settings(max_examples=50, timeout=0)
714+
def test_complete_tournament(self, strategies, prob_end,
715+
seed, reps):
713716
"""
714717
A test to check that a spatial tournament on the complete graph
715718
gives the same results as the round robin.
@@ -720,12 +723,14 @@ def test_complete_tournament(self, strategies, prob_end, seed):
720723
for j in range(i, len(players))]
721724
# create a prob end round robin tournament
722725
axelrod.seed(seed)
723-
tournament = axelrod.ProbEndTournament(players, prob_end=prob_end)
726+
tournament = axelrod.ProbEndTournament(players, prob_end=prob_end,
727+
repetitions=reps)
724728
results = tournament.play(progress_bar=False)
725729
# create a complete spatial tournament
726730
axelrod.seed(seed)
727731
spatial_tournament = axelrod.ProbEndSpatialTournament(players,
728732
prob_end=prob_end,
733+
repetitions=reps,
729734
edges=edges)
730735
spatial_results = spatial_tournament.play(progress_bar=False)
731736
self.assertEqual(results.match_lengths, spatial_results.match_lengths)
@@ -737,8 +742,10 @@ def test_complete_tournament(self, strategies, prob_end, seed):
737742

738743

739744
@given(tournament=spatial_tournaments(strategies=axelrod.basic_strategies,
740-
max_turns=1),
745+
max_turns=1, max_noise=0,
746+
max_repetitions=3),
741747
seed=integers(min_value=0, max_value=4294967295))
748+
@settings(max_examples=50, timeout=0)
742749
def test_one_turn_tournament(self, tournament, seed):
743750
"""
744751
Tests that gives same result as the corresponding spatial round robin

0 commit comments

Comments
 (0)