[R-pkg-devel] Package used unconditionally only in testing

Greg Freedman Ellis gd|erm@|| @end|ng |rom gm@||@com
Fri Jan 8 15:17:58 CET 2021


Hi all,

I'm trying to update a package to conform to pass tests given
`_R_CHECK_DEPENDS_ONLY_=TRUE`.

In this package, we only use the package `httptest` during testing, but the
tests are (almost) meaningless if it is not installed, so I would like to
indicate that it is a required package rather than skipping tests if it is
not installed.

If I move `httptest` to Depends, then I get the error CRAN check note:
> Namespace in Imports field not imported from: ‘httptest’
>   All declared Imports should be used.

I think this would best be solved by a DESCRIPTION field that indicates a
package is required, but only for tests, but I do not see such a field. The
only solution I can think of is to have a trivial import of `httptest` in
the main package to silence the NOTE. Is there a better solution?

Greg Freedman Ellis

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list