[proxy] github.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

bpo-37828: Fix default mock_name in unittest.mock.assert_called error by categulario · Pull Request #16166 · python/cpython

the-knights-who-say-ni

… message

Abraham Toriz and others added 3 commits

September 15, 2019 16:09
* tests added

* add missing `self` parameter to test case
* use `assertRaisesRegex` instead of `assertRaisesRegexp`

Abraham Toriz added 2 commits

September 16, 2019 23:48
* A more descriptive blurb message
* Fix code to follow pep8

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Sep 17, 2019

…pythonGH-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').
(cherry picked from commit 5f5f11f)

Co-authored-by: Abraham Toriz Cruz <awonderfulcode@gmail.com>

miss-islington added a commit that referenced this pull request

Sep 17, 2019

…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').
(cherry picked from commit 5f5f11f)

Co-authored-by: Abraham Toriz Cruz <awonderfulcode@gmail.com>