tests/testthat/helper.R

local_db_pool <- function(env = parent.frame()) {
  pool <- dbPool(RSQLite::SQLite())
  withr::defer(poolClose(pool), envir = env)
  pool
}

checkCounts <- function(pool, free, taken) {
  expect_equal(pool$counters$free, free)
  expect_equal(pool$counters$taken, taken)
}

Try the pool package in your browser

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

pool documentation built on March 7, 2023, 6:49 p.m.