Comment

Comment by subleq

Have you tried patching the now() method onto datetime.datetime instead of replacing the whole class? If that doesn't work, you could replace datetime first:

    import freezegun; freezegun.monkey_patch()
    from datetime import datetime
After that, freeze_time would just set a flag on your datetime class.
parent subleq 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton