Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: cover ISO8601 date values accepted by Python 3.11 datetime module #659

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

jvtm
Copy link
Contributor

@jvtm jvtm commented Mar 28, 2023

Python 3.11 datetime module allows additional ISO8601 date, time and date-time formats that are not RFC3339 5.6 compliant.

This change adds tests for invalid date values that are at the moment allowed by at least Python jsonschema library as valid date sttrings.

Looks like date-time and time test cases already cover at least some values that are valid by ISO8601 but not by RFC3339 section 5.6.

See:

PR sent to jsonschema library python-jsonschema/jsonschema#1076.

@jvtm jvtm requested a review from a team as a code owner March 28, 2023 07:43
@jvtm
Copy link
Contributor Author

jvtm commented Mar 28, 2023

Need to fix few of these:

Description is too long (keep it to less than 70 chars).

Done, shortened the longest descriptions.

@jvtm jvtm marked this pull request as draft March 28, 2023 07:55
Python 3.11 `datetime` module allows additional ISO8601 date, time and
date-time formats that are not RFC3339 5.6 compliant.

This change adds tests for invalid `date` values that are at the moment
allowed by at least Python `jsonschema` library as valid `date` sttrings.

Looks like `date-time` and `time` test cases already cover at least some
values that are valid by ISO8601 but not by RFC3339 section 5.6.

See:
 * https://docs.python.org/3/whatsnew/3.11.html#datetime
 * python/cpython@1303f8c927
 * https://docs.python.org/3.11/library/datetime.html#datetime.date.fromisoformat
 * https://www.rfc-editor.org/rfc/rfc3339#section-5.6

PR sent to `jsonschema` library python-jsonschema/jsonschema#1076.
@jvtm jvtm force-pushed the python311-date-iso8601-values branch from 8aa9aee to 4248f3c Compare March 28, 2023 08:02
@jvtm jvtm marked this pull request as ready for review March 28, 2023 08:03
Copy link
Member

@Julian Julian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks great, thanks!

@Julian Julian merged commit 0788c22 into json-schema-org:main Mar 28, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants