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

Method decorate_async_callable

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

Source from the content-addressed store, hash-verified

1443
1444
1445 def decorate_async_callable(self, func):
1446 # NB. Keep the method in sync with decorate_callable()
1447 if hasattr(func, 'patchings'):
1448 func.patchings.append(self)
1449 return func
1450
1451 @wraps(func)
1452 async def patched(*args, **keywargs):
1453 with self.decoration_helper(patched,
1454 args,
1455 keywargs) as (newargs, newkeywargs):
1456 return await func(*newargs, **newkeywargs)
1457
1458 patched.patchings = [self]
1459 return patched
1460
1461
1462 def get_original(self):

Callers 1

__call__Method · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected