Skip to content

Commit cd6fc1d

Browse files
manycodingJulian
authored andcommitted
Revert style changes and test_it_does_not_validate_formats_by_default
1 parent ee627c4 commit cd6fc1d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

jsonschema/_validators.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,12 @@ def uniqueItems(validator, uI, instance, schema):
243243
yield ValidationError("%r has non-unique elements" % (instance,))
244244

245245

246-
def pattern(validator, pattern, instance, schema):
247-
if (validator.is_type(instance, "string") and not
248-
re.search(pattern, instance)):
249-
yield ValidationError("{} does not match {}".format(
250-
instance, pattern))
246+
def pattern(validator, patrn, instance, schema):
247+
if (
248+
validator.is_type(instance, "string") and
249+
not re.search(patrn, instance)
250+
):
251+
yield ValidationError("%r does not match %r" % (instance, patrn))
251252

252253

253254
def format(validator, format, instance, schema):

jsonschema/tests/test_validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,9 +991,9 @@ def test_it_returns_true_for_formats_it_does_not_know_about(self):
991991
)
992992
validator.validate("bugs")
993993

994-
def test_it_validates_formats_by_default(self):
994+
def test_it_does_not_validate_formats_by_default(self):
995995
validator = self.Validator({})
996-
self.assertIsInstance(validator.format_checker, FormatChecker)
996+
self.assertIsNone(validator.format_checker)
997997

998998
def test_it_validates_formats_if_a_checker_is_provided(self):
999999
checker = FormatChecker()

0 commit comments

Comments
 (0)