Skip to content
Prev 7677 / 12125 Next

[R-pkg-devel] Is using global assignment in package tests allowed?

I believe, in base R, package tests scripts are run sequentially in clean
sessions via R CMD BATCH. Test scripts can load packages, load data, etc,
but the state is lost from script to script.

Not sure about testthat tests / rstudio run tests button, because iirc it
recursively loads other scripts from a shim within a single job.

If I had to choose between writing a normal function, or a complicated
function that works with testthat scoping, I'd opt for the normal one.
On Thu, Jan 27, 2022 at 8:25 AM James Pustejovsky <jepusto at gmail.com> wrote: