tests/testthat/setup.R

try({
  if (requireNamespace("withr", quietly = TRUE)) {
    withr::defer({
      try(pool_stop(), silent = TRUE)
      try(closeAllConnections(), silent = TRUE)
    }, testthat::teardown_env())
  }
}, silent = TRUE)

Try the shard package in your browser

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

shard documentation built on April 3, 2026, 9:08 a.m.