On assert_called_with the assertionError have a very verbose error message, becuase it raise all the actual and expected request. For complex request, is difficult to know where is the difference.
As this happen only when there is a difference, i think there will not be a performance issue on replace
if not expected == actual:
expected_string = self._format_call_signature(
expected,
)
actual_string = self._format_call_signature(
actual
)
raise AssertionError(
'%s != %s' % (expected_string, actual_string)
)
in assert_called_with to a comparision of expected.args against actual.args and expected.kwargs against actual.kwargs with some formatting.
If you want i can create a PR with the change.