Skip to content

Commit dff229b

Browse files
committed
adds default game entry to tournament attributes dictionary
1 parent 3b9eac8 commit dff229b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

axelrod/player.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self):
3333
"""Initiates an empty history and 0 score for a player."""
3434
self.history = []
3535
self.stochastic = "random" in inspect.getsource(self.__class__)
36-
self.tournament_attributes = {'length': -1}
36+
self.tournament_attributes = {'length': -1, 'game': None}
3737
if self.name == "Player":
3838
self.stochastic = False
3939
self.cooperations = 0

axelrod/tests/unit/test_player.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ def test_initialisation(self):
9898
"""Test that the player initiates correctly."""
9999
self.assertEqual(self.player().history, [])
100100
self.assertEqual(self.player().stochastic, self.stochastic)
101-
self.assertEqual(self.player().tournament_attributes, {'length': -1})
101+
self.assertEqual(self.player().tournament_attributes,
102+
{'length': -1, 'game': None})
102103
self.assertEqual(self.player().cooperations, 0)
103104
self.assertEqual(self.player().defections, 0)
104105

0 commit comments

Comments
 (0)