Skip to content

Commit 1eccfb0

Browse files
committed
Add test for bug.
1 parent 0842ac1 commit 1eccfb0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

axelrod/tests/unit/test_resultset.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,13 @@ def test_eigenmoses_rating(self):
364364
for j, rate in enumerate(rs.eigenmoses_rating):
365365
self.assertAlmostEqual(rate, self.expected_eigenmoses_rating[j])
366366

367+
def test_self_interaction_for_random_strategies(self):
368+
# Based on https://github.com/Axelrod-Python/Axelrod/issues/670
369+
axelrod.seed(0)
370+
players = [s() for s in axelrod.demo_strategies]
371+
tournament = axelrod.Tournament(players, repetitions=2, turns=5)
372+
results = tournament.play()
373+
self.assertEqual(results.payoff_diffs_means[-1][-1], 1.0)
367374

368375
class TestResultSetFromFile(unittest.TestCase):
369376
tmp_file = tempfile.NamedTemporaryFile(mode='w', delete=False)

0 commit comments

Comments
 (0)