66See https://github.com/json-schema-org/JSON-Schema-Test-Suite for details.
77"""
88
9- import sys
109
1110from jsonschema .tests ._suite import Suite
1211import jsonschema
@@ -66,18 +65,6 @@ def complex_email_validation(test):
6665 )(test )
6766
6867
69- if sys .version_info < (3 , 9 ): # pragma: no cover
70- message = "Rejecting leading zeros is 3.9+"
71- allowed_leading_zeros = skip (
72- message = message ,
73- subject = "ipv4" ,
74- description = "invalid leading zeroes, as they are treated as octals" ,
75- )
76- else :
77- def allowed_leading_zeros (test ): # pragma: no cover
78- return
79-
80-
8168def leap_second (test ):
8269 message = "Leap seconds are unsupported."
8370 return skip (
@@ -149,8 +136,7 @@ def leap_second(test):
149136 Validator = jsonschema .Draft4Validator ,
150137 format_checker = jsonschema .Draft4Validator .FORMAT_CHECKER ,
151138 skip = lambda test : (
152- allowed_leading_zeros (test )
153- or leap_second (test )
139+ leap_second (test )
154140 or missing_format (jsonschema .Draft4Validator )(test )
155141 or complex_email_validation (test )
156142 ),
@@ -167,8 +153,7 @@ def leap_second(test):
167153 Validator = jsonschema .Draft6Validator ,
168154 format_checker = jsonschema .Draft6Validator .FORMAT_CHECKER ,
169155 skip = lambda test : (
170- allowed_leading_zeros (test )
171- or leap_second (test )
156+ leap_second (test )
172157 or missing_format (jsonschema .Draft6Validator )(test )
173158 or complex_email_validation (test )
174159 ),
@@ -187,8 +172,7 @@ def leap_second(test):
187172 Validator = jsonschema .Draft7Validator ,
188173 format_checker = jsonschema .Draft7Validator .FORMAT_CHECKER ,
189174 skip = lambda test : (
190- allowed_leading_zeros (test )
191- or leap_second (test )
175+ leap_second (test )
192176 or missing_format (jsonschema .Draft7Validator )(test )
193177 or complex_email_validation (test )
194178 ),
@@ -224,7 +208,6 @@ def leap_second(test):
224208 format_checker = jsonschema .Draft201909Validator .FORMAT_CHECKER ,
225209 skip = lambda test : (
226210 complex_email_validation (test )
227- or allowed_leading_zeros (test )
228211 or leap_second (test )
229212 or missing_format (jsonschema .Draft201909Validator )(test )
230213 or complex_email_validation (test )
@@ -261,7 +244,6 @@ def leap_second(test):
261244 format_checker = jsonschema .Draft202012Validator .FORMAT_CHECKER ,
262245 skip = lambda test : (
263246 complex_email_validation (test )
264- or allowed_leading_zeros (test )
265247 or leap_second (test )
266248 or missing_format (jsonschema .Draft202012Validator )(test )
267249 or complex_email_validation (test )
0 commit comments