title: python retry with tenacity, disable `wait` for unittest
body: <p>I am using the <a href="https://github.com/jd/tenacity" rel="noreferrer">tenacity</a> library to use its <code>@retry</code> decorator.</p>
  
  <p>I am using this to make a function which makes a HTTP-request "repeat" multiple times in case of failure.</p>
  
  <p>Here is a simple code snippet:</p>
  
  <pre><code>@retry(stop=stop_after_attempt(7), wait=wait_random_exponential(multiplier=1, max=60))
  def func():
     ...
     requests.post(...)
  </code></pre>
  
  <p>The function uses the tenacity <code>wait</code>-argument to wait some time in between calls.</p>
  
  <p>The function together with the <code>@retry</code>-decorator seems to work fine.</p>
  
  <p>But I also have a unit-test which checks that the function gets called indeed 7 times in case of a failure. This test takes a lot of time because of this <code>wait</code> in beetween tries.</p>
  
  <p>Is it possible to somehow disable the wait-time only in the unit-test?</p>