tests/testthat/helper.R

# Global variables for test

# this file is called before testhat so funcion will be available in all test
# https://testthat.r-lib.org/articles/test-fixtures.html#withr-defer-
# could have used with_envvar and local_envvar but had to set them each time

env_set_test_stacomi <- function(env = parent.frame()) {
	o <- options()
	withr::defer(options(					
			stacomiR.dbname = "bd_contmig_nat",
			stacomiR.host ="localhost",
			stacomiR.port = "5432",
			stacomiR.user = "postgres",
			stacomiR.password = "postgres"					
	),	env)
assign("user","postgres",envir=env)
assign("password","postgres",envir=env)
assign("host", "localhost", envir=env)
assign("schema", "iav", envir=env)
}

Try the stacomirtools package in your browser

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

stacomirtools documentation built on Sept. 9, 2022, 3:07 p.m.