File tree 3 files changed +5
-29
lines changed
3 files changed +5
-29
lines changed Original file line number Diff line number Diff line change @@ -462,15 +462,15 @@ def is_uri_template(
462
462
463
463
464
464
try :
465
- import isodate
465
+ import isoduration
466
466
except ImportError :
467
467
pass
468
468
else :
469
469
@_checks_drafts (
470
470
draft202012 = "duration" ,
471
- raises = isodate . ISO8601Error ,
471
+ raises = isoduration . DurationParsingException ,
472
472
)
473
473
def is_duration (instance ):
474
474
if not isinstance (instance , str ):
475
475
return True
476
- return isodate .parse_duration (instance )
476
+ return isoduration .parse_duration (instance )
Original file line number Diff line number Diff line change @@ -172,29 +172,6 @@ def format_validation_annotation(test):
172
172
)(test )
173
173
174
174
175
- def duration_format_validation (test ):
176
- """
177
- isodata.parse_duration allows some formats that should not be parsed
178
- """
179
- return skip (
180
- message = bug (),
181
- subject = "duration" ,
182
- description = 'no time elements present' , # P1YT
183
- )(test ) or skip (
184
- message = bug (),
185
- subject = "duration" ,
186
- description = 'weeks cannot be combined with other units' , # P1Y2W
187
- )(test ) or skip (
188
- message = bug (),
189
- subject = "duration" ,
190
- description = 'zero time, in days' , # P0D
191
- )(test ) or skip (
192
- message = bug (),
193
- subject = "duration" ,
194
- description = 'zero time, in seconds' , # PT0S
195
- )(test )
196
-
197
-
198
175
def ecmascript_regex_validation (test ):
199
176
"""
200
177
Considering switching from re to js-regex after the following issues are resolved:
@@ -642,7 +619,6 @@ def ecmascript_regex_validation(test):
642
619
or leap_second (test )
643
620
or missing_format (draft202012_format_checker )(test )
644
621
or complex_email_validation (test )
645
- or duration_format_validation (test )
646
622
or format_validation_annotation (test )
647
623
or ecmascript_regex_validation (test )
648
624
or skip (
Original file line number Diff line number Diff line change @@ -38,15 +38,15 @@ format =
38
38
rfc3987
39
39
strict-rfc3339
40
40
webcolors
41
- isodate
41
+ isoduration
42
42
format_nongpl =
43
43
fqdn
44
44
idna
45
45
jsonpointer>1.13
46
46
webcolors
47
47
rfc3986-validator>0.1.0
48
48
rfc3339-validator
49
- isodate
49
+ isoduration
50
50
51
51
[options.entry_points]
52
52
console_scripts =
You can’t perform that action at this time.
0 commit comments