Commit 2b32da2f authored by davidair's avatar davidair Committed by Gregory P. Smith

Improve error message when mock.assert_has_calls fails (GH-8205)

This makes the assertion error message more useful, aiding debugging.

Thanks @davidair!
parent a2510732
......@@ -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
......
Improved an error message when mock assert_has_calls fails.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment