r-lib / testthat

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

Could the stack trace of `expect_no_*()` be reduced? #1965

Open olivroy opened 1 month ago

olivroy commented 1 month ago

if I have the following


test_that("test", {

  expect_no_error(function_that_throws_a_warning())

})

I get the following trace in the build pane on Windows. I am noting that the expect_no_error() traceback takes 11 lines, but it doesn't seem very interesting to know that expect_no_error calls all these functions? Lines 2 to 11 don't feel relevant to me.

image

Is there a solution for that?

Verify also if the trace from expect_warning(regexp = NA) is smaller?