Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ericmoritz
on Dec 11, 2012
|
parent
|
context
|
favorite
| on:
FreezeGun: easy mocking of Python datetimes
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.
new_test
on Dec 12, 2012
[–]
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Pure functions make tests simple.