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

Function _get_target

Lib/unittest/mock.py:1684–1690  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

1682
1683
1684def _get_target(target):
1685 try:
1686 target, attribute = target.rsplit('.', 1)
1687 except (TypeError, ValueError, AttributeError):
1688 raise TypeError(
1689 f"Need a valid target to patch. You supplied: {target!r}")
1690 return partial(pkgutil.resolve_name, target), attribute
1691
1692
1693def _patch_object(

Callers 2

with_custom_patchMethod · 0.90
patchFunction · 0.85

Calls 2

partialClass · 0.90
rsplitMethod · 0.45

Tested by 1

with_custom_patchMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…