Skip to content

Commit 7cb4686

Browse files
tryCatch approach with specific error handler
1 parent dcf0abf commit 7cb4686

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/testthat/test-standalone-errors.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ test_that("chain_call", {
134134
})
135135

136136
test_that("errors from subprocess", {
137-
skip_if(!requireNamespace("callr", quietly = TRUE) || packageVersion("callr") != "3.7.0", "only with callr exactly 3.7.0")
137+
skip_if_not(isTRUE(tryCatch(packageVersion("callr") == "3.7.0", packageNotFoundError = function(c) FALSE)), "only with callr exactly 3.7.0")
138138
err <- tryCatch(
139139
callr::r(function() 1 + "a"),
140140
error = function(e) e

0 commit comments

Comments
 (0)