@@ -1423,6 +1423,9 @@ def test_enum_allows_non_unique_items(self):
1423
1423
1424
1424
1425
1425
class ValidatorTestMixin (MetaSchemaTestsMixin , object ):
1426
+ def test_it_implements_the_validator_protocol (self ):
1427
+ self .assertIsInstance (self .Validator ({}), protocols .Validator )
1428
+
1426
1429
def test_valid_instances_are_valid (self ):
1427
1430
schema , instance = self .valid
1428
1431
self .assertTrue (self .Validator (schema ).is_valid (instance ))
@@ -2134,21 +2137,6 @@ def test_helpful_error_message_on_failed_pop_scope(self):
2134
2137
self .assertIn ("Failed to pop the scope" , str (exc .exception ))
2135
2138
2136
2139
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
-
2152
2140
def sorted_errors (errors ):
2153
2141
def key (error ):
2154
2142
return (
0 commit comments