MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _get_target

Function _get_target

tools/python-3.11.9-amd64/Lib/unittest/mock.py:1611–1617  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

1609
1610
1611def _get_target(target):
1612 try:
1613 target, attribute = target.rsplit('.', 1)
1614 except (TypeError, ValueError, AttributeError):
1615 raise TypeError(
1616 f"Need a valid target to patch. You supplied: {target!r}")
1617 return partial(pkgutil.resolve_name, target), attribute
1618
1619
1620def _patch_object(

Callers 2

with_custom_patchMethod · 0.90
patchFunction · 0.85

Calls 2

partialClass · 0.90
rsplitMethod · 0.80

Tested by 1

with_custom_patchMethod · 0.72