tests/testthat/setup.R

# location to download the JDBC drivers used in the tests
jdbcDriverFolder <- tempfile("jdbcDrivers")
co <- getOption("connectionObserver")
options(connectionObserver=NULL)

withr::defer({
  options(connectionObserver=co)
  unlink(jdbcDriverFolder, recursive = TRUE, force = TRUE)
}, testthat::teardown_env())


dbms <- getOption("dbms", default = "sqlite")
connectionDetails <- getTestDatabaseConnectionDetails(dbms = dbms, jdbcDriverFolder = jdbcDriverFolder)
cdmDatabaseSchema <- getTestDatabaseSchema(dbms = dbms)

Try the SelfControlledCohort package in your browser

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

SelfControlledCohort documentation built on June 17, 2026, 5:07 p.m.