From: Senthil Kumaran Date: Tue, 12 Jan 2016 14:18:32 +0000 (-0800) Subject: Issue25347 - Format the error message output of mock's assert_has_calls method. X-Git-Tag: v3.6.0a1~785 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=121edbf7e26ad0ac887ac4a2bf46316deb05737e;p=python Issue25347 - Format the error message output of mock's assert_has_calls method. Patch contributed by Robert Zimmerman. --- diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 976f663c0a..21f49fab1b 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -820,7 +820,7 @@ class NonCallableMock(Base): if expected not in all_calls: raise AssertionError( 'Calls not found.\nExpected: %r\n' - 'Actual: %r' % (calls, self.mock_calls) + 'Actual: %r' % (_CallList(calls), self.mock_calls) ) from cause return