We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
FakeDatetime
timestamp()
datetime().timestamp()
the result of timestamp() on a FakeDatetime is not the same result as in a datetime.datetime.
datetime.datetime
I would expect this to succed:
t = datetime.datetime(2024, 1, 1, 12, 0, 0) with freeze_time(t): assert datetime.datetime.now().timestamp() == t.timestamp()
but it fails with:
AssertionError: assert 1704110400.0 == 1704106800.0
The text was updated successfully, but these errors were encountered:
it works it I set a tz_info t = datetime.datetime(2024, 1, 1, 12, 0, tzinfo=datetime.UTC). No real clue what is going on but maybe it is because naive timestamp have to be computed manually and the implementation of the original timestamp doesn't look nice at all: https://github.com/python/cpython/blob/31a28cbae0989f57ad01b428c007dade24d9593a/Lib/_pydatetime.py#L1893
t = datetime.datetime(2024, 1, 1, 12, 0, tzinfo=datetime.UTC)
Sorry, something went wrong.
No branches or pull requests
the result of
timestamp()
on a FakeDatetime is not the same result as in adatetime.datetime
.I would expect this to succed:
but it fails with:
The text was updated successfully, but these errors were encountered: