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

Method get_original

tools/python-3.11.9-amd64/Lib/unittest/mock.py:1401–1422  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1399
1400
1401 def get_original(self):
1402 target = self.getter()
1403 name = self.attribute
1404
1405 original = DEFAULT
1406 local = False
1407
1408 try:
1409 original = target.__dict__[name]
1410 except (AttributeError, KeyError):
1411 original = getattr(target, name, DEFAULT)
1412 else:
1413 local = True
1414
1415 if name in _builtins and isinstance(target, ModuleType):
1416 self.create = True
1417
1418 if not self.create and original is DEFAULT:
1419 raise AttributeError(
1420 "%s does not have the attribute %r" % (target, name)
1421 )
1422 return original, local
1423
1424
1425 def __enter__(self):

Callers 1

__enter__Method · 0.95

Calls 1

getterMethod · 0.80

Tested by

no test coverage detected