I have an application where, for testing, I need to replace the time.time () call with a specific timestamp, I did this in the past using ruby
(code is available here: http://github.com/zemariamm/Back-to-Future/blob/master/back_to_future.rb )
However, I do not know how to do this using Python.
Any clues? Hooray, the Maria
You can simply set time.time to point to your new time function, for example:
import time def my_time(): return 0.0 old_time = time.time time.time = my_time
Source: https://habr.com/ru/post/1304139/More articles:Does distributed source control, such as Mercurial, use for a single command? - version-controlUsing client.status in C # with sharpsvn - c #Code Analysis: Global Project / Build Suppression - .netremove some tags from html document using C # - htmlRegular expression removes space and dash - regexWhat are the benefits of automatically generating @override annotations in the IDE? - javaCannot configure JAX-WS to configure binding - javaHow to use DataPager with a Paged database - c #Form authentication is ignored in virtual application - asp.netJavascript Mouseover bubbling from kids - javascriptAll Articles