-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Frozen time doesn't adher to timezone information #325
Comments
Reading through the sources and adjusting the test for using zoneinfo instead of pytz: ...
tzinfo = zoneinfo.ZoneInfo(tz)
... Results into: tz='Australia/Sydney'
unfrozen time: 2023-02-12 12:53:15.123167+01:00
frozen time: 2023-02-02 00:00:00
frozen time: 2023-02-02 10:00:00+11:00 This looks already better, however the first call (without the tzinfo) should imho also result in 10am. |
pytz is effectively deprecated in favour of zoneinfo, see the problems with it in this post: https://blog.ganssle.io/articles/2018/03/pytz-fastest-footgun.html I don’t really wanna dive in and add support myself but if you can come up with a short well tested PR, I would consider it. |
Thanks @adamchainz for the enlighting post. After reading it, I don't think I even want to try to implement it. |
Python Version
3.9.13
pytest Version
7.1.2
Package Version
2.9.0
Description
I'll dive right in with a code sample:
Result:
Expected result:
I don't know why there is such a strange number subtracted because afaik timezones are 1h or half an hour difference.
Additionally the "frozen time" should reflect the provided datetime?
As I understand it: I want to travel back to Feb 2 10 am in Brisbane...?
The text was updated successfully, but these errors were encountered: