-
Notifications
You must be signed in to change notification settings - Fork 506
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
Fix error message for gettz when passed bytes #935
Conversation
Results of timeitInitial Testpython -m timeit -n 1000 -s "from dateutil.tz import gettz; gettz('America/New_York')"
# Before change
1000 loops, best of 5: 3.76 usec per loop
:0: UserWarning: The test results are likely unreliable. The worst time (241 usec) was more than four times slower than the best time (3.76 usec).
# After change
1000 loops, best of 5: 3.78 usec per loop
:0: UserWarning: The test results are likely unreliable. The worst time (204 usec) was more than four times slower than the best time (3.78 usec). Optimized testThe initial test experiences a slow initial call (i believe during loading of tzfile) so I optimized it to only count subsequent gettz calls. python -m timeit -n 1000 -s "from dateutil.tz import gettz; gettz('America/Los_Angeles')" "gettz('America/New_York')"
# Before change
1000 loops, best of 5: 2.42 usec per loop
# After change
1000 loops, best of 5: 2.28 usec per loop ConclusionThe timeit differences are statistically insignificant |
@labrys Sorry for the delay in the review here, this mostly looks good, I've gone ahead and rebased this and pushed a few changes to it. We generally don't use I've gone ahead and refactored your tests. I also think that your example of I'm planning to cut a release tonight, so please let me know if you have any objections to my changes before then. I'll merge whenever you sign off or when it's closer to release time if I don't hear from you today. |
@pganssle Sounds good to me. |
Summary of changes
Fix error message for gettz when passed bytes
Closes #927
Pull Request Checklist