Skip to content

Commit 2bb7f52

Browse files
committed
#782: Split format and regular test cases on draft2020-12
1 parent b0911cf commit 2bb7f52

File tree

1 file changed

+16
-102
lines changed

1 file changed

+16
-102
lines changed

jsonschema/tests/test_jsonschema_test_suite.py

Lines changed: 16 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -128,99 +128,6 @@ def leap_second(test):
128128
)(test)
129129

130130

131-
def format_validation_annotation(test):
132-
"""
133-
https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/464
134-
introduces some tests that contradict the test definitions that are
135-
currently available inside optional/format for each of the formats.
136-
"""
137-
return skip(
138-
message="Not supported",
139-
subject="format",
140-
description="invalid email string is only an annotation by default",
141-
)(test) or skip(
142-
message="Not supported",
143-
subject="format",
144-
description="invalid idn-email string is only an annotation by "
145-
"default",
146-
)(test) or skip(
147-
message="Not supported",
148-
subject="format",
149-
description="invalid regex string is only an annotation by default",
150-
)(test) or skip(
151-
message="Not supported",
152-
subject="format",
153-
description="invalid ipv4 string is only an annotation by default",
154-
)(test) or skip(
155-
message="Not supported",
156-
subject="format",
157-
description="invalid ipv6 string is only an annotation by default",
158-
)(test) or skip(
159-
message="Not supported",
160-
subject="format",
161-
description="invalid hostname string is only an annotation by default",
162-
)(test) or skip(
163-
message="Not supported",
164-
subject="format",
165-
description="invalid idn-hostname string is only an annotation by"
166-
" default",
167-
)(test) or skip(
168-
message="Not supported",
169-
subject="format",
170-
description="invalid duration string is only an annotation by default",
171-
)(test) or skip(
172-
message="Not supported",
173-
subject="format",
174-
description="invalid date string is only an annotation by default",
175-
)(test) or skip(
176-
message="Not supported",
177-
subject="format",
178-
description="invalid iri string is only an annotation by default",
179-
)(test) or skip(
180-
message="Not supported",
181-
subject="format",
182-
description="invalid iri-reference string is only an annotation by"
183-
" default",
184-
)(test) or skip(
185-
message="Not supported",
186-
subject="format",
187-
description="invalid json-pointer string is only an annotation by"
188-
" default",
189-
)(test) or skip(
190-
message="Not supported",
191-
subject="format",
192-
description="invalid uri-reference string is only an annotation by"
193-
" default",
194-
)(test) or skip(
195-
message="Not supported",
196-
subject="format",
197-
description="invalid uri string is only an annotation by default",
198-
)(test) or skip(
199-
message="Not supported",
200-
subject="format",
201-
description="invalid date-time string is only an annotation by "
202-
"default",
203-
)(test) or skip(
204-
message="Not supported",
205-
subject="format",
206-
description="invalid relative-json-pointer string is only an "
207-
"annotation by default",
208-
)(test) or skip(
209-
message="Not supported",
210-
subject="format",
211-
description="invalid time string is only an annotation by default",
212-
)(test) or skip(
213-
message="Not supported",
214-
subject="format",
215-
description="invalid uuid string is only an annotation by default",
216-
)(test) or skip(
217-
message="Not supported",
218-
subject="format",
219-
description="invalid uri-template string is only an annotation by"
220-
" default",
221-
)(test)
222-
223-
224131
def ecmascript_regex_validation(test):
225132
"""
226133
Considering switching from re to js-regex after the following issues are
@@ -552,24 +459,16 @@ def ecmascript_regex_validation(test):
552459
)
553460

554461

555-
DRAFT202012 = DRAFT202012.to_unittest_testcase(
462+
TestDraft202012 = DRAFT202012.to_unittest_testcase(
556463
DRAFT202012.tests(),
557-
DRAFT202012.format_tests(),
558464
DRAFT202012.optional_tests_of(name="bignum"),
559465
DRAFT202012.optional_tests_of(name="ecmascript-regex"),
560466
DRAFT202012.optional_tests_of(name="float-overflow"),
561467
DRAFT202012.optional_tests_of(name="non-bmp-regex"),
562468
DRAFT202012.optional_tests_of(name="refOfUnknownKeyword"),
563469
Validator=Draft202012Validator,
564-
format_checker=draft202012_format_checker,
565470
skip=lambda test: (
566471
narrow_unicode_build(test)
567-
or missing_date_fromisoformat(test)
568-
or allowed_leading_zeros(test)
569-
or leap_second(test)
570-
or missing_format(draft202012_format_checker)(test)
571-
or complex_email_validation(test)
572-
or format_validation_annotation(test)
573472
or ecmascript_regex_validation(test)
574473
or skip(
575474
message="ToDo: Extend validation",
@@ -589,3 +488,18 @@ def ecmascript_regex_validation(test):
589488
)(test)
590489
),
591490
)
491+
492+
493+
TestDraft202012Format = DRAFT202012.to_unittest_testcase(
494+
DRAFT202012.format_tests(),
495+
Validator=Draft202012Validator,
496+
format_checker=draft202012_format_checker,
497+
skip=lambda test: (
498+
complex_email_validation(test)
499+
or missing_date_fromisoformat(test)
500+
or allowed_leading_zeros(test)
501+
or leap_second(test)
502+
or missing_format(draft202012_format_checker)(test)
503+
or complex_email_validation(test)
504+
)
505+
)

0 commit comments

Comments
 (0)