mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
bpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)
In the format string for assert_called the evaluation order is incorrect and hence for mock's without name, 'None' is printed whereas it should be 'mock' like for other messages. The error message is ("Expected '%s' to have been called." % self._mock_name or 'mock').
This commit is contained in:
parent
219fb9d65e
commit
5f5f11faf9
3 changed files with 11 additions and 1 deletions
|
|
@ -0,0 +1,2 @@
|
|||
Fix default mock name in :meth:`unittest.mock.Mock.assert_called` exceptions.
|
||||
Patch by Abraham Toriz Cruz.
|
||||
Loading…
Add table
Add a link
Reference in a new issue