[issue9528] Add pure Python implementation of time module to CPython
Marc-Andre Lemburg
report at bugs.python.org
Wed Aug 10 19:39:52 CEST 2011
Marc-Andre Lemburg <mal at egenix.com> added the comment:
Alan Justino wrote:
>
> I am getting a hard time trying to do some BDD with c-based datetime because I cannot mock it easily to force datetime.datetime.now() to return a desired value, making almost impossible to test time-based code, like the accounting system that I am refactoring right now.
It's usually better to use a central helper get_current_time() in
the application, than to use datetime.now() and others
directly.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9528>
_______________________________________
More information about the Python-bugs-list
mailing list