r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.39k stars 760 forks source link

devtools::test_check fails with "no test files found" error #2497

Closed jayruffell closed 1 year ago

jayruffell commented 1 year ago

My test infrastructure is set thusly (created via usethis::use_testthat), and I haven't touched any code inside testthat.R:

package_directory/tests/testhat/test-xxx.R
package_directory/tests/testthat.R

And my working dir is set to C:/dev/r/packages/my_package_name

When I run devtools::test(), testthat::test_package("my_package_name"), or testthat::test_local() , tests run fine. When I run testthat::test_check("my_package_name") I get the following error:

Error in `test_dir()`:
! No test files found

Have tested on multiple machines and tried moving my package into different directories and no luck. Session info:

R 4.2.2
devtools 2.4.5
testthat 3.1.6

Similar issue to https://github.com/r-lib/testthat/issues/205, but moving the tests into the tests/ directory doesn't fix in my case.

Thanks for the help.