Skip to content
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

test actually loaded environment with devtools #16

Open
cbeleites opened this issue Jul 30, 2021 · 0 comments
Open

test actually loaded environment with devtools #16

cbeleites opened this issue Jul 30, 2021 · 0 comments

Comments

@cbeleites
Copy link
Collaborator

currently, unittest() uses getNamespace() which will return the installed package.

When the package is loaded via devtools, that version should be tested:
hySpc.testthat::unittest() should first check whether ns %in% devtools::dev_packages(). If so, it's a package loaded by devtools.

In that case, look recursively through parent.env(.GlobalEnv) for paste0("package:", ns).

Otherwise, getNamespace() is the way to go.

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

No branches or pull requests

1 participant