testify
testify copied to clipboard
proposal: print full path when displaying error location
Currently, the error indicates only the file name, not the full path.
Example:
event_test.go:46:
Error Trace: event_test.go:46
Error: Received unexpected error:
It bothers me because I have the same file name within different packages (/model/event.go, /query/event.go), and my IDE can not identify uniquely the file.
Desired output:
query/event_test.go:46:
Error Trace: query/event_test.go:46
Error: Received unexpected error:
Or:
/home/xxx/dev/project/query/event_test.go:46:
Error Trace: /home/xxx/dev/project/query/event_test.go:46
Error: Received unexpected error:
I guess something could be done on the testify source code near assert/assertions.go:151, but doing it in a backward-compatible way will be difficult. I don't know if is is something that the maintainers want. If it is, I'm ready to work on a PR.