Skip to content
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

gh-113569: Display calls in Mock.assert_has_calls failure when empty #113573

Merged

Conversation

wookie184
Copy link
Contributor

@wookie184 wookie184 commented Dec 29, 2023

@wookie184
Copy link
Contributor Author

News failed the lint, but now i'm thinking this probably doesn't even need news, should I just remove it?

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change needs a NEWS entry :)

Lib/test/test_unittest/testmock/testmock.py Outdated Show resolved Hide resolved
Lib/unittest/mock.py Outdated Show resolved Hide resolved
Lib/unittest/mock.py Outdated Show resolved Hide resolved
Lib/unittest/mock.py Outdated Show resolved Hide resolved
Lib/test/test_unittest/testmock/testmock.py Show resolved Hide resolved
Lib/unittest/mock.py Outdated Show resolved Hide resolved
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about displaying " Actual: not called" like in assert_called_with()?

@wookie184
Copy link
Contributor Author

Thank you everyone for the reviews so far by the way, it's appreciated :)

@cjw296
Copy link
Contributor

cjw296 commented Jan 4, 2024

@wookie184 - this looks ready to merge now, is that correct?

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@serhiy-storchaka serhiy-storchaka merged commit 1600d78 into python:main Jan 4, 2024
29 checks passed
@serhiy-storchaka
Copy link
Member

Thank you for your contribution @wookie184. It is not only added a useful feature, but made the code tidier in general.

@cjw296
Copy link
Contributor

cjw296 commented Jan 4, 2024

Any backports needed @serhiy-storchaka ?

@serhiy-storchaka
Copy link
Member

This is a new feature, not a bug fix.

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.

Display actual calls for unittest.assert_has_calls even if empty
4 participants