File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 33import os
44import unittest
55from typing import Any , Text
6-
6+ import warnings
77import yaml
88
99import axelrod as axl
@@ -42,6 +42,10 @@ def __init__(self, x: Any):
4242
4343
4444class TestClassification (unittest .TestCase ):
45+ def setUp (self ) -> None :
46+ # Ignore warnings about classifiers running on instances
47+ warnings .simplefilter ("ignore" , category = UserWarning )
48+
4549 def test_classifier_build (self ):
4650 dirname = os .path .dirname (__file__ )
4751 test_path = os .path .join (dirname , "../../../test_outputs/classifier_test.yaml" )
@@ -82,7 +86,12 @@ def test_will_lookup_key_in_dict(self):
8286 self .assertEqual (Classifiers ["memory_depth" ](TitForTatWithEmptyClassifier ), 1 )
8387
8488 def test_will_lookup_key_for_classes_that_cant_init (self ):
85- self .assertEqual (Classifiers ["memory_depth" ](TitForTatWithNonTrivialInitialzer ), 1 )
89+ with self .assertRaises (Exception ) as exptn :
90+ Classifiers ["memory_depth" ](TitForTatWithNonTrivialInitialzer )
91+ self .assertEqual (
92+ str (exptn .exception ),
93+ "Passed player class doesn't have a trivial initializer." ,
94+ )
8695
8796 def test_known_classifiers (self ):
8897 # A set of dimensions that are known to have been fully applied
You can’t perform that action at this time.
0 commit comments