MCPcopy Index your code
hub / github.com/python/cpython / decorate_callable

Method decorate_callable

Lib/unittest/mock.py:1428–1442  ·  view source on GitHub ↗
(self, func)

Source from the content-addressed store, hash-verified

1426
1427
1428 def decorate_callable(self, func):
1429 # NB. Keep the method in sync with decorate_async_callable()
1430 if hasattr(func, 'patchings'):
1431 func.patchings.append(self)
1432 return func
1433
1434 @wraps(func)
1435 def patched(*args, **keywargs):
1436 with self.decoration_helper(patched,
1437 args,
1438 keywargs) as (newargs, newkeywargs):
1439 return func(*newargs, **newkeywargs)
1440
1441 patched.patchings = [self]
1442 return patched
1443
1444
1445 def decorate_async_callable(self, func):

Callers 1

__call__Method · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected