Live data from Hacker News

FreezeGun: easy mocking of Python datetimes

stevepulec.com

11–18 of 18 posts

Re: FreezeGun: easy mocking of Python datetimes

#16

nice project. I usually avoid this by making my APIs accept a datetime objects and make the client code create the datetime object. Pure functions make tests simple.

That's what I've been doing, but not because I believe it to be a better way, but because I'm to lazy to implement my own FreezeGun. I don't think the production code should contain unnecessary complexity that is only used for testing.

Re: FreezeGun: easy mocking of Python datetimes

#18

Rubyists desiring similar functionality should check out either of the following libs. As far as I can tell they differ only in their pun selection. https://github.com/travisjeffery/timecop https://github.com/bebanjo/delorean In the ruby community, disliking someone's choice of science fiction reference is grounds for a rewrite.

So I need to write one called "tardis"?
Post reply on HN