Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (16 sloc) 464 Bytes
from functools import wraps
from unittest import mock
except ImportError:
import mock
def _cleanUpPatch(fn):
def cleaned(self, *args, **kwargs):
patch = fn(*args, **kwargs)
return patch.start()
return cleaned
class PatchMixin(object):
patch = _cleanUpPatch(mock.patch)
patchDict = _cleanUpPatch(mock.patch.dict)
patchObject = _cleanUpPatch(mock.patch.object)
Something went wrong with that request. Please try again.