MCPcopy Index your code
hub / github.com/RustPython/RustPython / decorate_async_callable

Method decorate_async_callable

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

Source from the content-addressed store, hash-verified

1436
1437
1438 def decorate_async_callable(self, func):
1439 # NB. Keep the method in sync with decorate_callable()
1440 if hasattr(func, 'patchings'):
1441 func.patchings.append(self)
1442 return func
1443
1444 @wraps(func)
1445 async def patched(*args, **keywargs):
1446 with self.decoration_helper(patched,
1447 args,
1448 keywargs) as (newargs, newkeywargs):
1449 return await func(*newargs, **newkeywargs)
1450
1451 patched.patchings = [self]
1452 return patched
1453
1454
1455 def get_original(self):

Callers 1

__call__Method · 0.95

Calls 2

hasattrFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected