Why is helper file in testthat sourced twice
问题 I run into trouble when using uuids in tests, as the helper file is sourced twice. Why does that happen? Is there a way to avoid second sourcing? For a reproducible example, just create a new package, put a file called "helper-data.R" in /tests/testhat/ with th following content if (!exists("test_ind")) { test_ind <- 1 print(paste0("test_ind = ", test_ind)) test_ind <- test_ind + 1 } else { print(paste0("test_ind = ", test_ind)) test_ind <- test_ind + 1 } and create an file "test-1.R" in