closeio / freezefrog

Python library to efficiently mock datetimes in unit tests
MIT License
4 stars 2 forks source link

FreezeFrog should also mock datetime.datetime.now #1

Closed lucasvo closed 4 years ago

lucasvo commented 8 years ago

FreezeFrog should raise an exception when datetime.datetime.now() is used without a TZ instead of not mocking it at all.

lucasvo commented 8 years ago

Unfortunately we have libraries that use dateime.now() and therefore unless we mock datetime.now() we won't be able to use those. As nice as it is, unless we start monkey patching libraries or go on a crusade to eradicate datetime.now() from the world, we need to be able to patch datetime.now()

thomasst commented 4 years ago

This was done in https://github.com/closeio/freezefrog/commit/2e653ab2c363208ddb7fc2958cc4bc81d7e72952

thomasst commented 4 years ago

(For issues with it, see https://github.com/closeio/freezefrog/issues/10)