Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It sounds like your problem was with the test, not necessarily the developers calling datetime.now().


The problem is that developers do not know that they mustn't call datetime.now() and there will always be a developer who doesn't know this, either because people have a tough time knowing everything, or just because you're hiring new people.

Wouldn't it be nice if you could just obstruct such patterns within the first millisecond of their first interaction with the compiler?


    > developers do not know that they mustn't call
    > datetime.now()
Plenty of languages where it's easy to mock the equivalent to that call.


I don't have a problem with it. I send a mocked time to the application under test using libfaketime using this: http://hitchtest.com

Et voila, no more time issues.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: