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

Method _calls_repr

Lib/unittest/mock.py:1100–1110  ·  view source on GitHub ↗

Renders self.mock_calls as a string. Example: "\nCalls: [call(1), call(2)]." If self.mock_calls is empty, an empty string is returned. The output will be truncated if very long.

(self)

Source from the content-addressed store, hash-verified

1098
1099
1100 def _calls_repr(self):
1101 """Renders self.mock_calls as a string.
1102
1103 Example: "\nCalls: [call(1), call(2)]."
1104
1105 If self.mock_calls is empty, an empty string is returned. The
1106 output will be truncated if very long.
1107 """
1108 if not self.mock_calls:
1109 return ""
1110 return f"\nCalls: {safe_repr(self.mock_calls)}."
1111
1112
1113# Denylist for forbidden attribute names in safe mode

Callers 3

assert_not_calledMethod · 0.95
assert_called_onceMethod · 0.95

Calls 1

safe_reprFunction · 0.90

Tested by

no test coverage detected