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

Align error messages when mock call assertion fails #424

Closed
EdvardM opened this Issue Mar 27, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@EdvardM
Copy link

EdvardM commented Mar 27, 2018

Rationale:

Mock objects print assertion failures in a way that is hard to read.

Example:

AssertionError: Expected call: <mock assertion failure: 1122331 ...>
Actual call: <mock assertion failure: 112331 ...>

After the patch:

AssertionError:
Expected call: <mock assertion failure: 1122331 ...>
Actual call:   <mock assertion failure: 112331 ...>

There's a quick implementation for this at
https://github.com/EdvardM/mock/tree/better-actual-expected-error-messages

with tests. Though I'm still wondering should the calls be indentented, eg.

AssertionError:
  Expected call: <mock assertion failure: 1122331 ...>
  Actual call:   <mock assertion failure: 112331 ...>
@cjw296

This comment has been minimized.

Copy link
Contributor

cjw296 commented Nov 29, 2018

This repo is only for issues that are specific to the backport.
Please report issues with mock in the upstream bug tracker at https://bugs.python.org/.
Once issues are fixed upstream, they can be backported here.

@cjw296 cjw296 closed this Nov 29, 2018

@cjw296 cjw296 added the upstream label Nov 29, 2018

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