Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
olivroy opened this issue May 23, 2024 · 2 comments
Closed

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

olivroy opened this issue May 23, 2024 · 2 comments
Labels
conditions feature a feature request or enhancement

Comments

@olivroy
Copy link
Contributor

olivroy commented May 23, 2024

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?

@hadley
Copy link
Member

hadley commented Jul 3, 2024

The mechanisms exist in rlang to trim the call stack; the challenge will be figuring out exactly what should form the top of the callstack and how do we get that information to where the back trace is generated.

@hadley hadley added feature a feature request or enhancement conditions labels Oct 22, 2024
@hadley
Copy link
Member

hadley commented Oct 22, 2024

I think I'm going to close this, just because when we've tried to automatically minimise the stack we've hit a case where we accidentally hide info that we do actually want.

@hadley hadley closed this as completed Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conditions feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants