title: Python mock patch a function decorator's parameter value
body: <p>Lets say I have a settings.py</p>
  
  <pre><code>value = 10
  </code></pre>
  
  <p>and I have a function like this with a decorator inside module a</p>
  
  <pre><code>import settings
  
  @some_decorator(repeat=settings.value):
  def do_work():
     print settings.value
     // prints 1
     ...
  </code></pre>
  
  <p>In unittest I am trying to patch the settings.value to 1 like this:</p>
  
  <pre><code>with patch('settings.value', new=1):
      do_work()
  </code></pre>
  
  <p>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?</p>