mirror of https://github.com/python/cpython
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
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Improved an error message when mock assert_has_calls fails.
|
Loading…
Reference in New Issue