Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (16 sloc) 0.464 kb
from functools import wraps
try:
from unittest import mock
except ImportError:
import mock
def _cleanUpPatch(fn):
@wraps(fn)
def cleaned(self, *args, **kwargs):
patch = fn(*args, **kwargs)
self.addCleanup(patch.stop)
return patch.start()
return cleaned
class PatchMixin(object):
patch = _cleanUpPatch(mock.patch)
patchDict = _cleanUpPatch(mock.patch.dict)
patchObject = _cleanUpPatch(mock.patch.object)
Jump to Line
Something went wrong with that request. Please try again.