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

Method decorate_callable

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

Source from the content-addressed store, hash-verified

1419
1420
1421 def decorate_callable(self, func):
1422 # NB. Keep the method in sync with decorate_async_callable()
1423 if hasattr(func, 'patchings'):
1424 func.patchings.append(self)
1425 return func
1426
1427 @wraps(func)
1428 def patched(*args, **keywargs):
1429 with self.decoration_helper(patched,
1430 args,
1431 keywargs) as (newargs, newkeywargs):
1432 return func(*newargs, **newkeywargs)
1433
1434 patched.patchings = [self]
1435 return patched
1436
1437
1438 def decorate_async_callable(self, func):

Callers 1

__call__Method · 0.95

Calls 2

hasattrFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected