I have a package where I need to test the creation and manipulation of a folder with testthat. Thus I wrote a test, which
Appart from the fact that the helperfile is sourced twice (See here - I found a workaround for that) I run into trouble because building the package also creates the test-folder?
This only happend, when I went to RStudio -> Tools -> Project Options -> Build Tools -> Create docs with roxygen and check "build and reload".
I have no clue, why the folder is created! Can anybody help? Of course, the folder should ne be created with the package build!
The example package can be found here
Update: Created issue on github-testthat
After support from the package owners on Github: roxygen uses devtools::load_all()
, which loads test helpers. If you don't want the code in helpers to be run during devtools::load_all() you should define them in a setup-*
file rather than a helper-*
file.
But it seems the issue is gone using latest R/RStudio/devtools versions: now everything is running as expected without any changes suggested above!