tests/testthat/test-parallel-outside.R

test_that("error outside of test_that()", {
  withr::local_envvar(TESTTHAT_PARALLEL = "TRUE")
  err <- tryCatch(
    suppressMessages(testthat::test_local(
      test_path("test-parallel", "outside"),
      reporter = "silent"
    )),
    error = function(e) e
  )

  expect_match(err$message, "Test failures")
})

Try the testthat package in your browser

Any scripts or data that you put into this service are public.

testthat documentation built on Jan. 21, 2022, 1:10 a.m.