Skip to content

[3.8] bpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)#16229

Merged
miss-islington merged 1 commit into
python:3.8from
miss-islington:backport-5f5f11f-3.8
Sep 17, 2019
Merged

[3.8] bpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)#16229
miss-islington merged 1 commit into
python:3.8from
miss-islington:backport-5f5f11f-3.8

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 17, 2019

Copy link
Copy Markdown
Contributor

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

https://bugs.python.org/issue37828

…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

Copy link
Copy Markdown
Contributor Author

@categulario and @pablogsal: Status check is done, and it's a success ✅ .

@miss-islington
miss-islington merged commit f668d2b into python:3.8 Sep 17, 2019
@miss-islington
miss-islington deleted the backport-5f5f11f-3.8 branch September 17, 2019 11:35
@miss-islington

Copy link
Copy Markdown
Contributor Author

@categulario and @pablogsal: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington

Copy link
Copy Markdown
Contributor Author

@categulario and @pablogsal: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants