@@ -1423,6 +1423,9 @@ def test_enum_allows_non_unique_items(self):
14231423
14241424
14251425class ValidatorTestMixin (MetaSchemaTestsMixin , object ):
1426+ def test_it_implements_the_validator_protocol (self ):
1427+ self .assertIsInstance (self .Validator ({}), protocols .Validator )
1428+
14261429 def test_valid_instances_are_valid (self ):
14271430 schema , instance = self .valid
14281431 self .assertTrue (self .Validator (schema ).is_valid (instance ))
@@ -2134,21 +2137,6 @@ def test_helpful_error_message_on_failed_pop_scope(self):
21342137 self .assertIn ("Failed to pop the scope" , str (exc .exception ))
21352138
21362139
2137- class TestValidatorProtocol (TestCase ):
2138- def test_each_validator_is_instance_of_protocol (self ):
2139- schema = {}
2140- for validator_cls in [
2141- validators .Draft3Validator ,
2142- validators .Draft4Validator ,
2143- validators .Draft6Validator ,
2144- validators .Draft7Validator ,
2145- validators .Draft201909Validator ,
2146- validators .Draft202012Validator ,
2147- ]:
2148- validator = validator_cls (schema )
2149- assert isinstance (validator , protocols .Validator )
2150-
2151-
21522140def sorted_errors (errors ):
21532141 def key (error ):
21542142 return (
0 commit comments