mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Improve error message when mock.assert_has_calls fails (GH-8205)
This makes the assertion error message more useful, aiding debugging. Thanks @davidair!
This commit is contained in:
parent
a2510732da
commit
2b32da2fea
2 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue