@@ -568,30 +568,18 @@ def test_init(self):
568
568
anonymous_tournament = axelrod .Tournament (players = self .players )
569
569
self .assertEqual (anonymous_tournament .name , 'axelrod' )
570
570
571
- @given (s = lists (sampled_from (axelrod .strategies ),
572
- min_size = 2 , # Errors are returned if less than 2 strategies
573
- max_size = 5 , unique = True ),
574
- prob_end = floats (min_value = .1 , max_value = .9 ),
575
- repetitions = integers (min_value = 2 , max_value = 4 ),
576
- rm = random_module ())
577
- @settings (max_examples = 50 , timeout = 0 )
578
- @example (s = test_strategies , prob_end = test_prob_end ,
579
- repetitions = test_repetitions ,
580
- rm = random .seed (0 ))
581
- def test_build_cache_never_required (self , s , prob_end , repetitions , rm ):
582
- """
583
- As the matches have a sampled length a cache is never required.
584
- """
585
- players = [strat () for strat in s ]
586
-
571
+ # Test init when passing a cache:
572
+ cache = axelrod .DeterministicCache ()
587
573
tournament = axelrod .ProbEndTournament (
588
574
name = self .test_name ,
589
- players = players ,
575
+ players = self . players ,
590
576
game = self .game ,
591
- prob_end = prob_end ,
592
- repetitions = repetitions )
593
- self .assertFalse (tournament ._build_cache_required ())
594
-
577
+ prob_end = self .test_prob_end ,
578
+ processes = 4 ,
579
+ noise = 0.2 ,
580
+ deterministic_cache = cache )
581
+ self .assertEqual (tournament .deterministic_cache , cache )
582
+ self .assertTrue (tournament .prebuilt_cache )
595
583
596
584
@given (s = lists (sampled_from (axelrod .strategies ),
597
585
min_size = 2 , # Errors are returned if less than 2 strategies
0 commit comments