-
Notifications
You must be signed in to change notification settings - Fork 523
Add hypothesis tests for isoparse #688
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
Conversation
7b5c5d2 to
f038715
Compare
| from hypothesis import given, assume | ||
| from hypothesis import strategies as st | ||
|
|
||
| from datetime import timedelta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is unused.
|
|
||
| @pytest.mark.isoparser | ||
| @given(dt=st.datetimes(timezones=TIME_ZONE_STRATEGY), sep=ASCII_STRATEGY) | ||
| def test_auto(dt, sep): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
@jbrockmendel Should I merge? |
|
Go for it. |
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