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

Use a defined sourceTime when using parsedatetime #359

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nicoe
Copy link
Contributor

@nicoe nicoe commented Aug 24, 2019

When using the parsedatetime functionalities freezegun is not used to
compute the source time. If the tests are run too close to midnight it
might result in the computation of 'tomorrow' being another day then
now() + 24h (because time.localtime() will be the next day) … thus
failing test_default_due2.

Setting sourceTime when calling parsedatime will ensure the same base is
used for all tests.

When using the parsedatetime functionalities freezegun is not used to
compute the source time. If the tests are run too close to midnight it
might result in the computation of 'tomorrow' being another day then
now() + 24h (because time.localtime() will be the next day) … thus
failing test_default_due2.

Setting sourceTime when calling parsedatime will ensure the same base is
used for all tests.
@nicoe
Copy link
Contributor Author

nicoe commented Aug 24, 2019

AFAICT this should fix #320

@WhyNotHugo
Copy link
Member

I'd rather decorate affected tests, and keep non-test code as is in this case.

Do you know exactly which tests are affected by this?

@nicoe
Copy link
Contributor Author

nicoe commented Aug 26, 2019 via email

Base automatically changed from master to main March 9, 2021 18:59
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.

2 participants