88
99import sys
1010
11- from jsonschema import (
12- Draft3Validator ,
13- Draft4Validator ,
14- Draft6Validator ,
15- Draft7Validator ,
16- Draft201909Validator ,
17- Draft202012Validator ,
18- draft3_format_checker ,
19- draft4_format_checker ,
20- draft6_format_checker ,
21- draft7_format_checker ,
22- draft201909_format_checker ,
23- draft202012_format_checker ,
24- )
2511from jsonschema .tests ._helpers import bug
2612from jsonschema .tests ._suite import Suite
13+ import jsonschema
2714
2815SUITE = Suite ()
2916DRAFT3 = SUITE .version (name = "draft3" )
@@ -164,11 +151,11 @@ def leap_second(test):
164151 DRAFT3 .optional_tests_of (name = "bignum" ),
165152 DRAFT3 .optional_tests_of (name = "non-bmp-regex" ),
166153 DRAFT3 .optional_tests_of (name = "zeroTerminatedFloats" ),
167- Validator = Draft3Validator ,
168- format_checker = draft3_format_checker ,
154+ Validator = jsonschema . Draft3Validator ,
155+ format_checker = jsonschema . draft3_format_checker ,
169156 skip = lambda test : (
170157 narrow_unicode_build (test )
171- or missing_format (draft3_format_checker )(test )
158+ or missing_format (jsonschema . draft3_format_checker )(test )
172159 or complex_email_validation (test )
173160 or skip (
174161 message = bug (371 ),
@@ -188,13 +175,13 @@ def leap_second(test):
188175 DRAFT4 .optional_tests_of (name = "float-overflow" ),
189176 DRAFT4 .optional_tests_of (name = "non-bmp-regex" ),
190177 DRAFT4 .optional_tests_of (name = "zeroTerminatedFloats" ),
191- Validator = Draft4Validator ,
192- format_checker = draft4_format_checker ,
178+ Validator = jsonschema . Draft4Validator ,
179+ format_checker = jsonschema . draft4_format_checker ,
193180 skip = lambda test : (
194181 narrow_unicode_build (test )
195182 or allowed_leading_zeros (test )
196183 or leap_second (test )
197- or missing_format (draft4_format_checker )(test )
184+ or missing_format (jsonschema . draft4_format_checker )(test )
198185 or complex_email_validation (test )
199186 or skip (
200187 message = bug (),
@@ -249,13 +236,13 @@ def leap_second(test):
249236 DRAFT6 .optional_tests_of (name = "bignum" ),
250237 DRAFT6 .optional_tests_of (name = "float-overflow" ),
251238 DRAFT6 .optional_tests_of (name = "non-bmp-regex" ),
252- Validator = Draft6Validator ,
253- format_checker = draft6_format_checker ,
239+ Validator = jsonschema . Draft6Validator ,
240+ format_checker = jsonschema . draft6_format_checker ,
254241 skip = lambda test : (
255242 narrow_unicode_build (test )
256243 or allowed_leading_zeros (test )
257244 or leap_second (test )
258- or missing_format (draft6_format_checker )(test )
245+ or missing_format (jsonschema . draft6_format_checker )(test )
259246 or complex_email_validation (test )
260247 or skip (
261248 message = "id is incorrectly finding non-ids" ,
@@ -290,13 +277,13 @@ def leap_second(test):
290277 DRAFT7 .optional_tests_of (name = "content" ),
291278 DRAFT7 .optional_tests_of (name = "float-overflow" ),
292279 DRAFT7 .optional_tests_of (name = "non-bmp-regex" ),
293- Validator = Draft7Validator ,
294- format_checker = draft7_format_checker ,
280+ Validator = jsonschema . Draft7Validator ,
281+ format_checker = jsonschema . draft7_format_checker ,
295282 skip = lambda test : (
296283 narrow_unicode_build (test )
297284 or allowed_leading_zeros (test )
298285 or leap_second (test )
299- or missing_format (draft7_format_checker )(test )
286+ or missing_format (jsonschema . draft7_format_checker )(test )
300287 or complex_email_validation (test )
301288 or skip (
302289 message = bug (),
@@ -350,7 +337,7 @@ def leap_second(test):
350337 DRAFT201909 .optional_tests_of (name = "float-overflow" ),
351338 DRAFT201909 .optional_tests_of (name = "non-bmp-regex" ),
352339 DRAFT201909 .optional_tests_of (name = "refOfUnknownKeyword" ),
353- Validator = Draft201909Validator ,
340+ Validator = jsonschema . Draft201909Validator ,
354341 skip = lambda test : (
355342 skip (
356343 message = "unevaluatedItems is different in 2019-09 (needs work)." ,
@@ -395,13 +382,13 @@ def leap_second(test):
395382
396383TestDraft201909Format = DRAFT201909 .to_unittest_testcase (
397384 DRAFT201909 .format_tests (),
398- Validator = Draft201909Validator ,
399- format_checker = draft201909_format_checker ,
385+ Validator = jsonschema . Draft201909Validator ,
386+ format_checker = jsonschema . draft201909_format_checker ,
400387 skip = lambda test : (
401388 complex_email_validation (test )
402389 or allowed_leading_zeros (test )
403390 or leap_second (test )
404- or missing_format (draft201909_format_checker )(test )
391+ or missing_format (jsonschema . draft201909_format_checker )(test )
405392 or complex_email_validation (test )
406393 ),
407394)
@@ -413,7 +400,7 @@ def leap_second(test):
413400 DRAFT202012 .optional_tests_of (name = "float-overflow" ),
414401 DRAFT202012 .optional_tests_of (name = "non-bmp-regex" ),
415402 DRAFT202012 .optional_tests_of (name = "refOfUnknownKeyword" ),
416- Validator = Draft202012Validator ,
403+ Validator = jsonschema . Draft202012Validator ,
417404 skip = lambda test : (
418405 narrow_unicode_build (test )
419406 or skip (
@@ -447,13 +434,13 @@ def leap_second(test):
447434
448435TestDraft202012Format = DRAFT202012 .to_unittest_testcase (
449436 DRAFT202012 .format_tests (),
450- Validator = Draft202012Validator ,
451- format_checker = draft202012_format_checker ,
437+ Validator = jsonschema . Draft202012Validator ,
438+ format_checker = jsonschema . draft202012_format_checker ,
452439 skip = lambda test : (
453440 complex_email_validation (test )
454441 or allowed_leading_zeros (test )
455442 or leap_second (test )
456- or missing_format (draft202012_format_checker )(test )
443+ or missing_format (jsonschema . draft202012_format_checker )(test )
457444 or complex_email_validation (test )
458445 ),
459446)
0 commit comments