Package dependency on testthat seems to be incorrect
atheriel opened this issue · 1 comments
atheriel commented
The testthat
package is listed as Suggests, but load_all()
calls library(testthat)
:
> pkgload::load_all()
ℹ Loading <my-package>
Error in ("base" %:::% "library")("testthat", warn.conflicts = FALSE) :
there is no package called ‘testthat’
> traceback()
3: stop(packageNotFoundError(package, lib.loc, sys.call()))
2: ("base" %:::% "library")("testthat", warn.conflicts = FALSE)
1: pkgload::load_all()
To reproduce:
- Uninstall
testthat
. - Run
pkgload::load_all()
on any package.
I think this could be fixed by checking if testthat
is present beforehand.
jimhester commented
A workaround is to call load_all with attach_testthat = FALSE
.
However we could probably add a test to uses_testthat()
to handle this case as well.