Skip to content

Commit 7a047d8

Browse files
manycodingJulian
authored andcommitted
Revert style changes and test_it_does_not_validate_formats_by_default
1 parent 316bd62 commit 7a047d8

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
@@ -186,11 +186,12 @@ def uniqueItems(validator, uI, instance, schema):
186186
yield ValidationError("%r has non-unique elements" % (instance,))
187187

188188

189-
def pattern(validator, pattern, instance, schema):
190-
if (validator.is_type(instance, "string") and not
191-
re.search(pattern, instance)):
192-
yield ValidationError("{} does not match {}".format(
193-
instance, pattern))
189+
def pattern(validator, patrn, instance, schema):
190+
if (
191+
validator.is_type(instance, "string") and
192+
not re.search(patrn, instance)
193+
):
194+
yield ValidationError("%r does not match %r" % (instance, patrn))
194195

195196

196197
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
@@ -1139,9 +1139,9 @@ def test_it_returns_true_for_formats_it_does_not_know_about(self):
11391139
)
11401140
validator.validate("bugs")
11411141

1142-
def test_it_validates_formats_by_default(self):
1142+
def test_it_does_not_validate_formats_by_default(self):
11431143
validator = self.Validator({})
1144-
self.assertIsInstance(validator.format_checker, FormatChecker)
1144+
self.assertIsNone(validator.format_checker)
11451145

11461146
def test_it_validates_formats_if_a_checker_is_provided(self):
11471147
checker = FormatChecker()

0 commit comments

Comments
 (0)