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

Method decoration_helper

Lib/unittest/mock.py:1407–1418  ·  view source on GitHub ↗
(self, patched, args, keywargs)

Source from the content-addressed store, hash-verified

1405
1406 @contextlib.contextmanager
1407 def decoration_helper(self, patched, args, keywargs):
1408 extra_args = []
1409 with contextlib.ExitStack() as exit_stack:
1410 for patching in patched.patchings:
1411 arg = exit_stack.enter_context(patching)
1412 if patching.attribute_name is not None:
1413 keywargs.update(arg)
1414 elif patching.new is DEFAULT:
1415 extra_args.append(arg)
1416
1417 args += tuple(extra_args)
1418 yield (args, keywargs)
1419
1420
1421 def decorate_callable(self, func):

Callers 1

patchedMethod · 0.95

Calls 3

enter_contextMethod · 0.80
updateMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected