golang / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
9.26k stars 608 forks source link

Unexpected access should print stack trace #690

Open feldentm-SAP opened 1 year ago

feldentm-SAP commented 1 year ago

Requested feature If a test makes an unexpected use of a mocked function, the call should result in a stack trace to fasten reaction to that error and help to detect if the code or the test is broken.

Why the feature is needed Improve usability and development speed. This impacts only the failing case which should only happen during development of a change. Thus, it does not affect retests of unchanged things and will equally not impact execution performance of test pipelines on successful runs.

(Optional) Proposed solution https://github.com/golang/mock/pull/680