-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add missing test cases for next()
/previous()
#5777
Conversation
It strikes me that we also ought to test for >>> now = 2020-10-19T13:53Z
>>> next(T-53)
2020-10-19T13:53Z
>>> previous(T-53)
2019-10-19T12:53Z Although in the latter case I'm really not clear what I'd expect the user to expect the correct answer to be. I think it probably should be the previous hour. |
Hang on a minute, it strikes me that
is a
bug
It should either be 2021-10-19T00:00Z # next year or 2020-10-19T13:53Z # same datetime |
That's definitely a bug. 🐞 ← (a well spotted bug) |
Yes, I would expect |
So the
question
|
The one that's in the future ("next year") because just as I.E. matching date-time components should not be a special case. |
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.
Nice use of xfail. Worth putting a comment with a link to #5795 in the code nearby?
A curious dev can use git blame |
We were not testing the case of
next()
andprevious()
where the truncated properties were the same as the current datetime. E.g.This behaviour does not seem to have been rigorously defined before? Adding these test cases ensures we do not break compatibility
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.?.?.x
branch.