stretchr / testify

A toolkit with common assertions and mocks that plays nicely with the standard library
MIT License
23.53k stars 1.6k forks source link

mock: caller information for unexpected method call #1644

Closed spirin closed 1 month ago

spirin commented 1 month ago

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

spirin commented 1 month ago

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