diff options
| -rw-r--r-- | Lib/unittest/mock.py | 4 | ||||
| -rw-r--r-- | Misc/NEWS.d/next/Tests/2018-07-10-18-53-46.bpo-0.UBQJBc.rst | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 19dabdd..db1e642 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -862,7 +862,9 @@ class NonCallableMock(Base): not_found.append(kall) if not_found: raise AssertionError( - '%r not all found in call list' % (tuple(not_found),) + '%r does not contain all of %r in its call list, ' + 'found %r instead' % (self._mock_name or 'mock', + tuple(not_found), all_calls) ) from cause diff --git a/Misc/NEWS.d/next/Tests/2018-07-10-18-53-46.bpo-0.UBQJBc.rst b/Misc/NEWS.d/next/Tests/2018-07-10-18-53-46.bpo-0.UBQJBc.rst new file mode 100644 index 0000000..9d82677 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2018-07-10-18-53-46.bpo-0.UBQJBc.rst @@ -0,0 +1 @@ +Improved an error message when mock assert_has_calls fails. |
