title: Can I patch a Python decorator before it wraps a function?
body: <p>I have a function with a decorator that I'm trying test with the help of the Python <a href="http://www.voidspace.org.uk/python/mock/" rel="noreferrer">Mock</a> library. I'd like to use <code>mock.patch</code> to replace the real decorator with a mock 'bypass' decorator which just calls the function.</p>
  
  <p>What I can't figure out is how to apply the patch before the real decorator wraps the function. I've tried a few different variations on the patch target and reordering the patch and import statements, but without success. Any ideas?</p>