r-lib / testthat

An R 📦 to make testing 😀
https://testthat.r-lib.org
Other
891 stars 317 forks source link

Improve stack trace by creating message in separate variable #1975

Closed olivroy closed 2 months ago

olivroy commented 3 months ago

Currently, we get this. This PR will simplify a little the message.

image

hadley commented 2 months ago

I think the problem is actually that stop_reporter() uses the error_call argument instead of the call argument. Do you mind fixing that instead? You could also add a snapshot test for stop_reporter() if you wanted.