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

mock: caller information for unexpected method call #1644

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

spirin
Copy link
Contributor

@spirin spirin commented Sep 30, 2024

Summary

When using mocks in large integration tests, it is very difficult to find places of unexpected function calls.

Changes

I suggest adding information about the location of the call.

Motivation

371770366-d54f21fd-e916-4ce9-805a-856a80bd3a20

Related issues

Copy link
Collaborator

@brackendawson brackendawson left a comment

Choose a reason for hiding this comment

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

This makes sense as an addition, especially given the else case already does it.

Can you update a test too please? Possibly TestArgumentMatcherToPrintMismatch but maybe something else. Confirming that the test's own file base name is in the stack should be sufficient.

@spirin
Copy link
Contributor Author

spirin commented Sep 30, 2024

Can you update a test too please? Possibly TestArgumentMatcherToPrintMismatch but maybe something else. Confirming that the test's own file base name is in the stack should be sufficient.

Done

Copy link
Collaborator

@brackendawson brackendawson left a comment

Choose a reason for hiding this comment

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

Thank you.

@brackendawson brackendawson merged commit 16a09b7 into stretchr:master Oct 1, 2024
7 checks passed
@spirin spirin deleted the unexpected-method-caller-info branch October 1, 2024 10:30
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.

2 participants