Lets say I have a settings.py
value = 10
and I have a function like this with a decorator inside module a
import settings
@some_decorator(repeat=settings.value):
def do_work():
print settings.value
// prints 1
...
In unittest I am trying to patch the settings.value to 1 like this:
with patch('settings.value', new=1):
do_work()
But the do_work function still gets repeated 10 times, I don't think the parameter of the decorator was patched because it gets executed before the unittest starts. How do I change this?