Skip to content

[3.7] bpo-36871: Handle spec errors in assert_has_calls (GH-16364)#16374

Merged
gpshead merged 3 commits into
python:3.7from
gpshead:backport-1a17a05-3.7
Sep 25, 2019
Merged

[3.7] bpo-36871: Handle spec errors in assert_has_calls (GH-16364)#16374
gpshead merged 3 commits into
python:3.7from
gpshead:backport-1a17a05-3.7

Conversation

@gpshead

@gpshead gpshead commented Sep 25, 2019

Copy link
Copy Markdown
Member

The fix in PR 13261 handled the underlying issue about the spec for specific methods not being applied correctly, but it didn't fix the issue that was causing the misleading error message.

The code currently grabs a list of responses from _call_matcher (which may include exceptions). But it doesn't reach inside the list when checking if the result is an exception. This results in a misleading error message when one of the provided calls does not match the spec.

https://bugs.python.org/issue36871

Co-authored-by: Samuel Freilich sfreilich@google.com

(cherry picked from commit 1a17a05)

https://bugs.python.org/issue36871

…) (pythonGH-16364)

The fix in PR 13261 handled the underlying issue about the spec for specific methods not being applied correctly, but it didn't fix the issue that was causing the misleading error message.

The code currently grabs a list of responses from _call_matcher (which may include exceptions). But it doesn't reach inside the list when checking if the result is an exception. This results in a misleading error message when one of the provided calls does not match the spec.

https://bugs.python.org/issue36871

Co-authored-by: Samuel Freilich <sfreilich@google.com>

(cherry picked from commit 1a17a05)
@gpshead gpshead merged commit 4042e1a into python:3.7 Sep 25, 2019
@gpshead gpshead deleted the backport-1a17a05-3.7 branch September 25, 2019 05:29
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