This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 lemburg
收信人 alanjds, amaury.forgeotdarc, belopolsky, brett.cannon, brian.curtin, daniel.urban, davidfraser, eric.araujo, giampaolo.rodola, lemburg, mark.dickinson, pitrou, r.david.murray, rhettinger, techtonik, tim.peters, vstinner
日期 2011-08-10.17:39:52
SpamBayes Score 6.4940534e-05
Marked as misclassified
Message-id <4E42C262.5020608@egenix.com>
In-reply-to <1312997390.95.0.573390430663.issue9528@psf.upfronthosting.co.za>
内容
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.
历史
日期 用户 动作 参数
2011-08-10 17:39:52lemburg修改recipients: + lemburg, tim.peters, brett.cannon, rhettinger, amaury.forgeotdarc, mark.dickinson, davidfraser, belopolsky, pitrou, vstinner, techtonik, giampaolo.rodola, eric.araujo, r.david.murray, brian.curtin, daniel.urban, alanjds
2011-08-10 17:39:52lemburg链接issue9528 messages
2011-08-10 17:39:52lemburg创建