8
8
9
9
import sys
10
10
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
- )
25
11
from jsonschema .tests ._helpers import bug
26
12
from jsonschema .tests ._suite import Suite
13
+ import jsonschema
27
14
28
15
SUITE = Suite ()
29
16
DRAFT3 = SUITE .version (name = "draft3" )
@@ -164,11 +151,11 @@ def leap_second(test):
164
151
DRAFT3 .optional_tests_of (name = "bignum" ),
165
152
DRAFT3 .optional_tests_of (name = "non-bmp-regex" ),
166
153
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 ,
169
156
skip = lambda test : (
170
157
narrow_unicode_build (test )
171
- or missing_format (draft3_format_checker )(test )
158
+ or missing_format (jsonschema . draft3_format_checker )(test )
172
159
or complex_email_validation (test )
173
160
or skip (
174
161
message = bug (371 ),
@@ -188,13 +175,13 @@ def leap_second(test):
188
175
DRAFT4 .optional_tests_of (name = "float-overflow" ),
189
176
DRAFT4 .optional_tests_of (name = "non-bmp-regex" ),
190
177
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 ,
193
180
skip = lambda test : (
194
181
narrow_unicode_build (test )
195
182
or allowed_leading_zeros (test )
196
183
or leap_second (test )
197
- or missing_format (draft4_format_checker )(test )
184
+ or missing_format (jsonschema . draft4_format_checker )(test )
198
185
or complex_email_validation (test )
199
186
or skip (
200
187
message = bug (),
@@ -249,13 +236,13 @@ def leap_second(test):
249
236
DRAFT6 .optional_tests_of (name = "bignum" ),
250
237
DRAFT6 .optional_tests_of (name = "float-overflow" ),
251
238
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 ,
254
241
skip = lambda test : (
255
242
narrow_unicode_build (test )
256
243
or allowed_leading_zeros (test )
257
244
or leap_second (test )
258
- or missing_format (draft6_format_checker )(test )
245
+ or missing_format (jsonschema . draft6_format_checker )(test )
259
246
or complex_email_validation (test )
260
247
or skip (
261
248
message = "id is incorrectly finding non-ids" ,
@@ -290,13 +277,13 @@ def leap_second(test):
290
277
DRAFT7 .optional_tests_of (name = "content" ),
291
278
DRAFT7 .optional_tests_of (name = "float-overflow" ),
292
279
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 ,
295
282
skip = lambda test : (
296
283
narrow_unicode_build (test )
297
284
or allowed_leading_zeros (test )
298
285
or leap_second (test )
299
- or missing_format (draft7_format_checker )(test )
286
+ or missing_format (jsonschema . draft7_format_checker )(test )
300
287
or complex_email_validation (test )
301
288
or skip (
302
289
message = bug (),
@@ -350,7 +337,7 @@ def leap_second(test):
350
337
DRAFT201909 .optional_tests_of (name = "float-overflow" ),
351
338
DRAFT201909 .optional_tests_of (name = "non-bmp-regex" ),
352
339
DRAFT201909 .optional_tests_of (name = "refOfUnknownKeyword" ),
353
- Validator = Draft201909Validator ,
340
+ Validator = jsonschema . Draft201909Validator ,
354
341
skip = lambda test : (
355
342
skip (
356
343
message = "unevaluatedItems is different in 2019-09 (needs work)." ,
@@ -395,13 +382,13 @@ def leap_second(test):
395
382
396
383
TestDraft201909Format = DRAFT201909 .to_unittest_testcase (
397
384
DRAFT201909 .format_tests (),
398
- Validator = Draft201909Validator ,
399
- format_checker = draft201909_format_checker ,
385
+ Validator = jsonschema . Draft201909Validator ,
386
+ format_checker = jsonschema . draft201909_format_checker ,
400
387
skip = lambda test : (
401
388
complex_email_validation (test )
402
389
or allowed_leading_zeros (test )
403
390
or leap_second (test )
404
- or missing_format (draft201909_format_checker )(test )
391
+ or missing_format (jsonschema . draft201909_format_checker )(test )
405
392
or complex_email_validation (test )
406
393
),
407
394
)
@@ -413,7 +400,7 @@ def leap_second(test):
413
400
DRAFT202012 .optional_tests_of (name = "float-overflow" ),
414
401
DRAFT202012 .optional_tests_of (name = "non-bmp-regex" ),
415
402
DRAFT202012 .optional_tests_of (name = "refOfUnknownKeyword" ),
416
- Validator = Draft202012Validator ,
403
+ Validator = jsonschema . Draft202012Validator ,
417
404
skip = lambda test : (
418
405
narrow_unicode_build (test )
419
406
or skip (
@@ -447,13 +434,13 @@ def leap_second(test):
447
434
448
435
TestDraft202012Format = DRAFT202012 .to_unittest_testcase (
449
436
DRAFT202012 .format_tests (),
450
- Validator = Draft202012Validator ,
451
- format_checker = draft202012_format_checker ,
437
+ Validator = jsonschema . Draft202012Validator ,
438
+ format_checker = jsonschema . draft202012_format_checker ,
452
439
skip = lambda test : (
453
440
complex_email_validation (test )
454
441
or allowed_leading_zeros (test )
455
442
or leap_second (test )
456
- or missing_format (draft202012_format_checker )(test )
443
+ or missing_format (jsonschema . draft202012_format_checker )(test )
457
444
or complex_email_validation (test )
458
445
),
459
446
)
0 commit comments