You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a fun use case to see if there's appetitate for me to raise a PR about. When using tick in my tests, I would love to be able to scroll through time at a faster rate as I have some mocked services which are set to emit events over the course of a day, and I'd love to not mock those services and simply have time progress at a faster rate when invoking datetime.now()
I believe the change itself would be fairly simple in the form of a new kwarg like tick_speed=1.0 when invoking freezegun, and then updating:
Are there any subtle caveats though which may make this not viable, before I throw some code together? The most glaring one I can think of is doing this may mean wanting to also mock time.sleep and its asyncio version, which may not play nice with various use cases like sleeping while something starts or initialises, but given the auto_tick_increment parameter effectively allows some scrolling through in, I feel it may be acceptable to say that this "does not cover time.sleep" and other timers (like thread.Timer)
The text was updated successfully, but these errors were encountered:
Hi all,
I've got a fun use case to see if there's appetitate for me to raise a PR about. When using
tick
in my tests, I would love to be able to scroll through time at a faster rate as I have some mocked services which are set to emit events over the course of a day, and I'd love to not mock those services and simply have time progress at a faster rate when invoking datetime.now()I believe the change itself would be fairly simple in the form of a new kwarg like
tick_speed=1.0
when invoking freezegun, and then updating:Are there any subtle caveats though which may make this not viable, before I throw some code together? The most glaring one I can think of is doing this may mean wanting to also mock
time.sleep
and its asyncio version, which may not play nice with various use cases like sleeping while something starts or initialises, but given theauto_tick_increment
parameter effectively allows some scrolling through in, I feel it may be acceptable to say that this "does not cover time.sleep" and other timers (like thread.Timer)The text was updated successfully, but these errors were encountered: