title: Dynamic parameters with Python's retry decorator
body: <p>I'm currently using the <a href="https://pypi.python.org/pypi/retrying" rel="nofollow noreferrer">python retrying package</a> which contains the <code>@retry</code> decorator that has a number of optional parameters. I have these parameters set correctly for our production environment with long enough wait times in between retries (below it's set to 2000 milliseconds) but I would like to set these values differently for unit testing purposes so that execution is very quick.</p>
  
  <p>For example here the wait_fixed time is set to 2000 milliseconds for production but for my unit test that calls <code>some_function()</code> I'd like to override the <code>wait_fixed</code> parameter to be 1 millisecond so it executes very quickly.</p>
  
  <pre><code>@retry(stop_max_attempt_number=3, wait_fixed=2000)
  def some_function(self):
      return True
  </code></pre>
  
  <p>The problem I'm running into is that the decorator is <a href="https://stackoverflow.com/questions/2884771/how-to-pass-in-dynamic-data-to-decorators">interpreted when the function is defined</a> so as of yet I have not found a way to override the <code>wait_fixed</code> parameter from my unit tests. </p>