-
Notifications
You must be signed in to change notification settings - Fork 340
Closed
Description
See this testcase: as the function is not producing an error, I would expect one error to be reported:
test_that("showing problem", {
local_edition(3)
expect_error(identity(1),
"Error message", fixed = TRUE)
})Instead, besides an error I also get a warning and backtrace just because I am using fixed = TRUE:
══ Testing test_test.R ══════════════════════════════════════════════════
[ FAIL 1 | WARN 1 | SKIP 0 | PASS 0 ]
── Failure (test_test.R:3:3): showing problem ──────────────────────────────────
`identity(1)` did not throw the expected error.
── Warning (test_test.R:3:3): showing problem ──────────────────────────────────
Arguments in `...` must be used.
x Problematic argument:
* fixed = TRUE
i Did you misspell an argument name?
Backtrace:
▆
1. ├─testthat::expect_error(identity(1), "Error message", fixed = TRUE) at test_test.R:3:3
2. │ └─testthat:::expect_condition_matching(...)
3. │ └─rlang (local) `<fn>`()
4. │ └─rlang:::check_dots(env, error, action, call)
5. │ └─rlang:::action_dots(...)
6. │ ├─rlang (local) try_dots(...)
7. │ │ └─rlang::try_fetch(expr, error = error)
8. │ │ ├─base::tryCatch(...)
9. │ │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
10. │ │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
11. │ │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
12. │ │ └─base::withCallingHandlers(...)
13. │ └─rlang (local) action(...)
14. │ └─rlang:::signal_abort(cnd, .file)
15. │ └─base::signalCondition(cnd)
16. └─rlang (local) `<fn>`(`<rlb_rr__>`)
17. └─handlers[[1L]](cnd)
[ FAIL 1 | WARN 1 | SKIP 0 | PASS 0 ]
Metadata
Metadata
Assignees
Labels
No labels