diff options
author | Julian Berman <Julian@GrayVines.com> | 2021-12-15 11:24:53 -0500 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2021-12-15 11:24:53 -0500 |
commit | 0878727e6dc39f1f9268a626a6b6390b2dde2f4a (patch) | |
tree | cbc7705b40a8dce30c6ccbb246495c870f93c0fd | |
parent | 5b4d5b7a6446ea8854df66cdf7fff74d03f6d2f6 (diff) | |
download | jsonschema-0878727e6dc39f1f9268a626a6b6390b2dde2f4a.tar.gz |
Shorten the protocol test.v4.3.0
-rw-r--r-- | jsonschema/tests/test_validators.py | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/jsonschema/tests/test_validators.py b/jsonschema/tests/test_validators.py index 9e52ce9..67082d5 100644 --- a/jsonschema/tests/test_validators.py +++ b/jsonschema/tests/test_validators.py @@ -1423,6 +1423,9 @@ class MetaSchemaTestsMixin(object): class ValidatorTestMixin(MetaSchemaTestsMixin, object): + def test_it_implements_the_validator_protocol(self): + self.assertIsInstance(self.Validator({}), protocols.Validator) + def test_valid_instances_are_valid(self): schema, instance = self.valid self.assertTrue(self.Validator(schema).is_valid(instance)) @@ -2134,21 +2137,6 @@ class TestRefResolver(TestCase): self.assertIn("Failed to pop the scope", str(exc.exception)) -class TestValidatorProtocol(TestCase): - def test_each_validator_is_instance_of_protocol(self): - schema = {} - for validator_cls in [ - validators.Draft3Validator, - validators.Draft4Validator, - validators.Draft6Validator, - validators.Draft7Validator, - validators.Draft201909Validator, - validators.Draft202012Validator, - ]: - validator = validator_cls(schema) - assert isinstance(validator, protocols.Validator) - - def sorted_errors(errors): def key(error): return ( |