Skip to content
Prev 7669 / 12125 Next

[R-pkg-devel] Is using global assignment in package tests allowed?

On Thu, 27 Jan 2022 08:55:49 -0600
James Pustejovsky <jepusto at gmail.com> wrote:

            
What are you trying to achieve? Perhaps there's a better way to do
that. I think that you can ask testthat-specific questions at
<https://community.rstudio.com/> if they turn out to be too far from
base R.
I'm not a CRAN member, but I think that the spirit of the rule only
covers the user-accessible code, and tests aren't typically run in the
same R session where the user objects live. For the same reason, I
think that it's acceptable to test internal interfaces you don't want
to export by calling them by means of package:::function.