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

Function _delegating_property

Lib/unittest/mock.py:355–370  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

353
354
355def _delegating_property(name):
356 _allowed_names.add(name)
357 _the_name = '_mock_' + name
358 def _get(self, name=name, _the_name=_the_name):
359 sig = self._mock_delegate
360 if sig is None:
361 return getattr(self, _the_name)
362 return getattr(sig, name)
363 def _set(self, value, name=name, _the_name=_the_name):
364 sig = self._mock_delegate
365 if sig is None:
366 self.__dict__[_the_name] = value
367 else:
368 setattr(sig, name, value)
369
370 return property(_get, _set)
371
372
373

Callers 2

NonCallableMockClass · 0.85
AsyncMockMixinClass · 0.85

Calls 2

propertyClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…