Skip to content

Commit 59f156d

Browse files
committed
Update tournament test to only compare ranked_names
1 parent 96cef67 commit 59f156d

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
@@ -753,26 +753,27 @@ def test_write_to_csv_without_results(self):
753753
def test_seeding_equality(self, seed):
754754
"""Tests that a tournament with a given seed will return the
755755
same results each time."""
756-
players = [axl.Random(0.4), axl.Random(0.6), axl.Random(0.8)]
756+
rng = axl.RandomGenerator(seed=seed)
757+
players = [axl.Random(rng.random()) for _ in range(8)]
757758
tournament1 = axl.Tournament(
758759
name=self.test_name,
759760
players=players,
760761
game=self.game,
761762
turns=3,
762-
repetitions=3,
763+
repetitions=100,
763764
seed=seed
764765
)
765766
tournament2 = axl.Tournament(
766767
name=self.test_name,
767768
players=players,
768769
game=self.game,
769770
turns=3,
770-
repetitions=3,
771+
repetitions=100,
771772
seed=seed
772773
)
773-
results1 = tournament1.play()
774-
results2 = tournament2.play()
775-
self.assertEqual(results1.summarise(), results2.summarise())
774+
results1 = tournament1.play(processes=2)
775+
results2 = tournament2.play(processes=2)
776+
self.assertEqual(results1.ranked_names, results2.ranked_names)
776777

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

0 commit comments

Comments
 (0)