I'd probably expect you to mock out whatever the decorator is calling out to instead.<div><br></div><div>Barring that there's not really a general way to retrieve the original function object off the decorated function without poking at its locals. At that point you'd probably be better off just storing an undecorated reference in your code to make it more testable.<span></span><br>
<br>On Wednesday, July 4, 2012, John Wong wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There are times when decorator really shine and I don't see a way to Mock out the decorator. I know it replaces the current function.... is there a way out of this?<br>
<br>Thanks.<br><br>John<br>
</blockquote></div>