This should not be necessary, because the method is wrapped in this logic:
def run_wrapper(*args, **kwargs): try: return run_method(*args, **kwargs) finally: self.__cleanup()
self.__cleanup() will call mocker.reset(), which does the restoring.
If you believe there's a problem in this logic, can you please provide a test case which demonstrates the problem?
This should not be necessary, because the method is wrapped in this logic:
def run_wrapper(*args, **kwargs):
return run_method(*args, **kwargs)
finally:
self. __cleanup( )
try:
self.__cleanup() will call mocker.reset(), which does the restoring.
If you believe there's a problem in this logic, can you please provide a test case which demonstrates the problem?