Code in a setup() block is run immediately in a clean environment. Code in a teardown() block is run upon completion of a test file, even if it exits with an error. Multiple calls to teardown() will be executed in the order they were created.

teardown(code, env = parent.frame())

setup(code, env = parent.frame())

## Arguments

code Code to evaluate Environment in which code will be evaluted. For expert use only.

## Examples

if (FALSE) {

tmp <- tempfile()
setup(writeLines(tmp, "some test data"))
}