Skip to content

Commit 0c34b4e

Browse files
committed
Freshen up crashing test
1 parent 8b53f7a commit 0c34b4e

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
test_that("crash", {
2-
# https://github.com/r-lib/rlang/commit/c84d52b6
3-
skip_if_not_installed("rlang", "1.0.1.9000")
4-
52
skip_on_cran()
63
skip_on_covr()
74
withr::local_envvar(TESTTHAT_PARALLEL = "TRUE")
85

9-
do <- function() {
10-
err <- NULL
6+
pkg <- test_path("test-parallel", "crash")
7+
err <- callr::r(function() {
118
tryCatch(
129
testthat::test_local(".", reporter = "summary", stop_on_failure = FALSE),
13-
error = function(e) err <<- e
10+
error = function(e) e
1411
)
15-
err
16-
}
17-
18-
pkg <- test_path("test-parallel", "crash")
19-
err <- callr::r(do, wd = pkg)
12+
}, wd = pkg)
2013
expect_s3_class(err, "testthat_process_error")
2114
expect_equal(err$test_file, "test-crash-3.R")
2215
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test_that("this crashes", {
22
expect_true(TRUE)
33
expect_true(FALSE)
4-
asNamespace("callr")$crash()
4+
rlang::node_car(0)
55
})

0 commit comments

Comments
 (0)