When running the following lines of code, devtools::test() fails with this error:

dir <- test_path() # "tests/testthat"
temp <- sandbox(dir)
Why is test_path() an invalid directory to delete? Is there a function that dir_delete can be replaced with in sandbox that will allow us to delete test_path()?