Skip to content

Commit b538fe7

Browse files
committed
Bump the validator version used for suite sanity checks.
And fix skipping regex format validation and the case where dynamicRef blows up. (The latter hopefully being temporary, but just so the PR passes)
1 parent c264401 commit b538fe7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

bin/jsonschema_suite

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,18 @@ class SanityTests(unittest.TestCase):
224224

225225
Validator = VALIDATORS.get(version.name)
226226
if Validator is not None:
227+
# Valid (optional test) schemas contain regexes which
228+
# aren't valid Python regexes, so skip checking it
229+
Validator.FORMAT_CHECKER.checkers.pop("regex", None)
230+
227231
test_files = collect(version)
228232
for case in cases(test_files):
229233
with self.subTest(case=case):
230234
try:
231-
Validator.check_schema(case["schema"])
235+
Validator.check_schema(
236+
case["schema"],
237+
format_checker=Validator.FORMAT_CHECKER,
238+
)
232239
except jsonschema.SchemaError:
233240
self.fail(
234241
"Found an invalid schema. "
@@ -262,6 +269,9 @@ class SanityTests(unittest.TestCase):
262269
with self.subTest(path=path):
263270
try:
264271
validator.validate(cases)
272+
except jsonschema.exceptions.RefResolutionError as error:
273+
# python-jsonschema/jsonschema#884
274+
pass
265275
except jsonschema.ValidationError as error:
266276
self.fail(str(error))
267277

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ skipsdist = True
55

66
[testenv:sanity]
77
# used just for validating the structure of the test case files themselves
8-
deps = jsonschema==4.6.1
8+
deps = jsonschema==4.17.3
99
commands = {envpython} bin/jsonschema_suite check

0 commit comments

Comments
 (0)