Skip to content

Package dependency on testthat seems to be incorrect #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
atheriel opened this issue Mar 12, 2021 · 1 comment
Closed

Package dependency on testthat seems to be incorrect #151

atheriel opened this issue Mar 12, 2021 · 1 comment

Comments

@atheriel
Copy link

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 calledtestthat> traceback()
3: stop(packageNotFoundError(package, lib.loc, sys.call()))
2: ("base" %:::% "library")("testthat", warn.conflicts = FALSE)
1: pkgload::load_all()

To reproduce:

  1. Uninstall testthat.
  2. Run pkgload::load_all() on any package.

I think this could be fixed by checking if testthat is present beforehand.

@jimhester
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants