Skip to content

Commit 1658a0c

Browse files
committed
Update tournament test to only compare ranked_names
1 parent 9beb4bd commit 1658a0c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

axelrod/tests/unit/test_tournament.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -754,26 +754,27 @@ def test_write_to_csv_without_results(self):
754754
def test_seeding_equality(self, seed):
755755
"""Tests that a tournament with a given seed will return the
756756
same results each time."""
757-
players = [axelrod.Random(0.4), axelrod.Random(0.6), axelrod.Random(0.8)]
757+
rng = axelrod.RandomGenerator(seed=seed)
758+
players = [axelrod.Random(rng.random()) for _ in range(8)]
758759
tournament1 = axelrod.Tournament(
759760
name=self.test_name,
760761
players=players,
761762
game=self.game,
762763
turns=3,
763-
repetitions=3,
764+
repetitions=100,
764765
seed=seed
765766
)
766767
tournament2 = axelrod.Tournament(
767768
name=self.test_name,
768769
players=players,
769770
game=self.game,
770771
turns=3,
771-
repetitions=3,
772+
repetitions=100,
772773
seed=seed
773774
)
774-
results1 = tournament1.play()
775-
results2 = tournament2.play()
776-
self.assertEqual(results1.summarise(), results2.summarise())
775+
results1 = tournament1.play(processes=2)
776+
results2 = tournament2.play(processes=2)
777+
self.assertEqual(results1.ranked_names, results2.ranked_names)
777778

778779
def test_seeding_inequality(self):
779780
players = [axelrod.Random(0.4), axelrod.Random(0.6)]

0 commit comments

Comments
 (0)