Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2019

Conversation

miss-islington
Copy link
Contributor

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

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
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
Contributor Author

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

1 similar comment
@miss-islington
Copy link
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