FreezeGun: easy mocking of Python datetimes
11–18 of 18 posts
Re: FreezeGun: easy mocking of Python datetimes
#12Thanks
Re: FreezeGun: easy mocking of Python datetimes
#13I've always used Mock http://www.voidspace.org.uk/python/mock/ to patch datetimes and I've never had any problems.
You can patch pretty much anything with Mock.
Re: FreezeGun: easy mocking of Python datetimes
#14I've always used Mock http://www.voidspace.org.uk/python/mock/ to patch datetimes and I've never had any problems.
You can patch pretty much anything with Mock.
Re: FreezeGun: easy mocking of Python datetimes
#15I don't really have much experience in datetimes I guess. What is this really good for? Can someone provide some use cases where this library might be helpful? Thanks
Re: FreezeGun: easy mocking of Python datetimes
#16nice 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.
Re: FreezeGun: easy mocking of Python datetimes
#17Re: FreezeGun: easy mocking of Python datetimes
#18Rubyists 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.