mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Closes issue 15323. Improve failure message of Mock.assert_called_once_with
This commit is contained in:
parent
494502756e
commit
28d591ceef
4 changed files with 13 additions and 4 deletions
|
@ -731,8 +731,8 @@ class NonCallableMock(Base):
|
|||
arguments."""
|
||||
self = _mock_self
|
||||
if not self.call_count == 1:
|
||||
msg = ("Expected to be called once. Called %s times." %
|
||||
self.call_count)
|
||||
msg = ("Expected '%s' to be called once. Called %s times." %
|
||||
(self._mock_name or 'mock', self.call_count))
|
||||
raise AssertionError(msg)
|
||||
return self.assert_called_with(*args, **kwargs)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue