@@ -45,7 +45,7 @@ def test_strategy(self):
45
45
# This behaviour is independent of knowledge of the Match length
46
46
actions = [(C , C ), (C , D ), (D , C ), (C , D ), (D , C )]
47
47
self .versus_test (axelrod .Alternator (), expected_actions = actions ,
48
- match_attributes = {"length" : - 1 })
48
+ match_attributes = {"length" : float ( "inf" ) })
49
49
50
50
# We can also test against random strategies
51
51
actions = [(C , D ), (D , D ), (D , C ), (C , C ), (C , D )]
@@ -576,7 +576,7 @@ def test_strategy(self):
576
576
577
577
actions = [(C , C ), (C , D ), (D , C ), (C , D ), (D , C ), (C , D )]
578
578
self .versus_test (axelrod .Alternator (), expected_actions = actions ,
579
- match_attributes = {"length" : - 1 })
579
+ match_attributes = {"length" : float ( "inf" ) })
580
580
581
581
actions = [(C , C ), (C , D ), (D , C ), (C , D ), (D , C ), (D , D )]
582
582
self .versus_test (axelrod .Alternator (), expected_actions = actions )
@@ -610,7 +610,7 @@ def test_strategy(self):
610
610
actions = [(C , C ), (C , C ), (C , C ), (C , C )]
611
611
self .versus_test (axelrod .Cooperator (), expected_actions = actions ,
612
612
attrs = {"is_defector" : False },
613
- match_attributes = {"length" : - 1 })
613
+ match_attributes = {"length" : float ( "inf" ) })
614
614
615
615
# Plays TfT and defects in last round
616
616
actions = [(C , C ), (C , D ), (D , C ), (C , D ), (D , C ), (D , D )]
@@ -620,7 +620,7 @@ def test_strategy(self):
620
620
actions = [(C , C ), (C , D ), (D , C ), (C , D ), (D , C ), (C , D )]
621
621
self .versus_test (axelrod .Alternator (), expected_actions = actions ,
622
622
attrs = {"is_defector" : False },
623
- match_attributes = {"length" : - 1 })
623
+ match_attributes = {"length" : float ( "inf" ) })
624
624
625
625
# Becomes defector after 5 defections
626
626
opponent = axelrod .MockPlayer (actions = [D , C , D , D , D , D , C , C ])
@@ -660,7 +660,7 @@ def test_strategy(self):
660
660
self .versus_test (axelrod .Defector (), expected_actions = actions , init_kwargs = init_kwargs )
661
661
actions = [(C , C ), (C , D ), (D , C ), (C , D ), (D , C )]
662
662
self .versus_test (axelrod .Alternator (), expected_actions = actions ,
663
- match_attributes = {"length" : - 1 }, init_kwargs = init_kwargs )
663
+ match_attributes = {"length" : float ( "inf" ) }, init_kwargs = init_kwargs )
664
664
actions = [(C , D ), (D , D ), (D , C ), (C , C ), (C , D )]
665
665
self .versus_test (axelrod .Random (), expected_actions = actions ,
666
666
seed = 0 , init_kwargs = init_kwargs )
@@ -744,7 +744,7 @@ def test_strategy(self):
744
744
actions = [(C , C ), (C , C ), (C , C ), (C , C )]
745
745
self .versus_test (axelrod .Cooperator (), expected_actions = actions ,
746
746
attrs = {"is_defector" : False },
747
- match_attributes = {"length" : - 1 }, seed = 2 )
747
+ match_attributes = {"length" : float ( "inf" ) }, seed = 2 )
748
748
749
749
actions = [(C , D ), (D , D ), (D , D ), (D , D )]
750
750
self .versus_test (axelrod .Defector (), expected_actions = actions ,
@@ -753,7 +753,7 @@ def test_strategy(self):
753
753
actions = [(C , D ), (D , D ), (D , D ), (D , D )]
754
754
self .versus_test (axelrod .Defector (), expected_actions = actions ,
755
755
attrs = {"is_defector" : False },
756
- match_attributes = {"length" : - 1 }, seed = 2 )
756
+ match_attributes = {"length" : float ( "inf" ) }, seed = 2 )
757
757
758
758
# Chance of becoming a defector is 50% after (D, C) occurs.
759
759
actions = [(C , C ), (C , D ), (D , C ), (C , D ), (D , C )]
@@ -767,4 +767,4 @@ def test_strategy(self):
767
767
actions = [(C , C ), (C , D ), (D , C ), (C , D ), (D , C ), (D , D ), (D , C )]
768
768
self .versus_test (axelrod .Alternator (), expected_actions = actions ,
769
769
attrs = {"is_defector" : True },
770
- match_attributes = {"length" : - 1 }, seed = 1 )
770
+ match_attributes = {"length" : float ( "inf" ) }, seed = 1 )
0 commit comments