Skip to content

gh-111019: Align expected and actual titles in test output #111020

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
Oct 18, 2023

Conversation

morisja
Copy link
Contributor

@morisja morisja commented Oct 18, 2023

Updates to output of assert_called_with/assert_has_calls

# before
  in assert_called_with
    raise AssertionError(_error_message()) from cause
AssertionError: expected call not found.
Expected: mock('foo', 'bar')
Actual: mock('foo', 'foo')


# after
  in assert_called_with
    raise AssertionError(_error_message()) from cause
AssertionError: expected call not found.
Expected: mock('foo', 'bar')
  Actual: mock('foo', 'foo')

----------------------------------------------------------------------

# before
  in assert_has_calls
    raise AssertionError(
AssertionError: Calls not found.
Expected: [call('foo', 'bar')]
  Actual: [call('foo', 'foo')]

# after
  in assert_has_calls
    raise AssertionError(
AssertionError: Calls not found.
Expected: [call('foo', 'bar')]
  Actual: [call('foo', 'foo')]

----------------------------------------------------------------------

Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
@morisja morisja requested a review from cjw296 as a code owner October 18, 2023 02:59
@ghost
Copy link

ghost commented Oct 18, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Oct 18, 2023

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@cjw296
Copy link
Contributor

cjw296 commented Oct 18, 2023

Yeah, this is a nice, small, quality of life improvement :-)

@cjw296 cjw296 merged commit 77dbd95 into python:main Oct 18, 2023
@miss-islington-app
Copy link

Thanks @morisja for the PR, and @cjw296 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 18, 2023
…honGH-111020)

Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
(cherry picked from commit 77dbd95)

Co-authored-by: James <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 18, 2023
…honGH-111020)

Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
(cherry picked from commit 77dbd95)

Co-authored-by: James <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 18, 2023

GH-111024 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Oct 18, 2023
@bedevere-app
Copy link

bedevere-app bot commented Oct 18, 2023

GH-111025 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Oct 18, 2023
cjw296 pushed a commit that referenced this pull request Oct 18, 2023
…-111020) (#111024)

gh-111019: Align expected and actual titles in test output (GH-111020)

Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
(cherry picked from commit 77dbd95)

Co-authored-by: James <[email protected]>
cjw296 pushed a commit that referenced this pull request Oct 18, 2023
…-111020) (#111025)

gh-111019: Align expected and actual titles in test output (GH-111020)

Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
(cherry picked from commit 77dbd95)

Co-authored-by: James <[email protected]>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…hon#111020)

Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…hon#111020)

Align expected and actual titles in output from
assert_has_calls/assert_called_with for greater readability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants