MCPcopy Create free account
hub / github.com/python/cpython / __repr__

Method __repr__

Lib/unittest/mock.py:767–785  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

765 return ''.join(_name_list)
766
767 def __repr__(self):
768 name = self._extract_mock_name()
769
770 name_string = ''
771 if name not in ('mock', 'mock.'):
772 name_string = ' name=%r' % name
773
774 spec_string = ''
775 if self._spec_class is not None:
776 spec_string = ' spec=%r'
777 if self._spec_set:
778 spec_string = ' spec_set=%r'
779 spec_string = spec_string % self._spec_class.__name__
780 return "<%s%s%s id='%s'>" % (
781 type(self).__name__,
782 name_string,
783 spec_string,
784 id(self)
785 )
786
787
788 def __dir__(self):

Callers

nothing calls this directly

Calls 2

_extract_mock_nameMethod · 0.95
idFunction · 0.85

Tested by

no test coverage detected