Add hypothesis tests for isoparse#688
Merged
Merged
Conversation
7b5c5d2 to
f038715
Compare
| from hypothesis import given, assume | ||
| from hypothesis import strategies as st | ||
|
|
||
| from datetime import timedelta |
Contributor
There was a problem hiding this comment.
Looks like this is unused.
|
|
||
| @pytest.mark.isoparser | ||
| @given(dt=st.datetimes(timezones=TIME_ZONE_STRATEGY), sep=ASCII_STRATEGY) | ||
| def test_auto(dt, sep): |
Contributor
There was a problem hiding this comment.
I like the round-trip test, seems like an ideal use case for hypothesis. Only question is about the name test_auto. Can that be clarified? I'm guessing the isoparser marker is intended to pull some of the weight in describing the test?
Member
Author
There was a problem hiding this comment.
Yeah, I'll change it to test_timespec_auto, though some of the weight is pulled by the isoparser mark but more by the fact that it's a test in test_isoparser_prop.py
f038715 to
8865384
Compare
Member
Author
|
@jbrockmendel Should I merge? |
Contributor
|
Go for it. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Tests the property that
dateutil.parser.parsewill support inversion ofdt.isoformat()in the somewhat limiting case thatsepis an ASCII character.Pull Request Checklist