Skip to content

Conversation

Liam3851
Copy link

Patch to solve #298. Freeze_time patches the pandas Timestamp, now, utcnow, and today methods if pandas is available on the system (i.e. an import pandas call does not fail) and has no effect if pandas is not installed.

The mocks are generated by wrapping the equivalent calls from FakeDatetime in a Timestamp constructor, so ticking/etc. functionality from the original class should flow directly. However, the mocked return value of Timestamp.now, Timestamp.today, and Timestamp.utcnow is currently Timestamp, but not FakeDatetime. If the latter is necessary (e.g. if it's contracted that any freezegun'd value is always a FakeDate/FakeDatetime) I can revise the PR.

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.

1 participant