I have a function with the following structure.
def foo(*args, **kwargs):
# ... code
now = pd.Timestamp('now', tz=0)
# ... more code
return result # result depends on "now" variable
I cannot take a timestamp right before or after the execution of foo
and use it for comparisons against the return value, because it will differ from the value of now
inside the function.