[Python-checkins] cpython: Issue25347 - Format the error message output of mock's assert_has_calls method.

senthil.kumaran python-checkins at python.org
Tue Jan 12 09:18:44 EST 2016


https://hg.python.org/cpython/rev/77d24f51effc
changeset:   99879:77d24f51effc
parent:      99877:4b434a4770a9
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Tue Jan 12 06:18:32 2016 -0800
summary:
  Issue25347 - Format the error message output of mock's assert_has_calls method.

Patch contributed by Robert Zimmerman.

files:
  Lib/unittest/mock.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -820,7 +820,7 @@
             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
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list