-
Notifications
You must be signed in to change notification settings - Fork 323
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
Consider traceback of expectation failures #729
Comments
Traceback would be great! Especially for things like |
Probably should use insights from |
And now insights from rlang |
Is this for compound expectations? We shouldn't get a backtrace in simple cases right? This doesn't seem very informative:
|
We could print the trace only when it has more than one call: expect_this_and_that <- function(x) {
expect_true(x)
expect_false(x)
}
test_that("bim bam boum", {
expect_false(TRUE)
expect_this_and_that(TRUE)
})
|
I would think this is most useful for expectations that take an expression, like |
Often the most important traceback is when there is an unexpected code error during a test. If we could avoid having the testthat calls in the traceback in these cases it would clear up debugging greatly. |
When run from R CMD check, how about recording backtraces for all test failures, and creating a |
Scratch that, it wouldn't be very useful since the relevant call stack (from the code that produced the result) has already unwound at the time the expectation is signalled. |
And minimise impact of quasiquotation as much as possible.
The text was updated successfully, but these errors were encountered: