-
Notifications
You must be signed in to change notification settings - Fork 312
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
Confusing behavior of test_package
and test_check
at top level
#257
Comments
If you want to run your tests during development the suggested method is |
This is a good explanation to be put in the docs then. I will be forgetting this and opening the same bug in half a year from now.
It doesn't make any sense to use another package to run |
Running tests is easy; reliably loading R code without installing the package is hard. So either install the package and run tests with |
The reason for this issue is not whether I can run it without loading, but regarding the confusing and incomplete documentation. The current doc says:
What does that I hope you will agree that those two paragraphs are confusing and most likely incorrect. As I said before, the only conclusion that I could vaguely infer from those lines is that (on an installed package) I run |
For future people running into this that may/may not be relevant to above: Ran into this problem when a You may want to run this in your package directory: pkg_name = read.dcf("DESCRIPTION")[, "Package"]
unlink(file.path("..", paste0(pkg_name, ".Rcheck"))) But you can also use library(here)
pkg_name = read.dcf("DESCRIPTION")[, "Package"]
unlink(here("..", paste0(pkg_name, ".Rcheck"))) |
I agree the documentation is ambiguous; I had to learn the hard way that the correct way to run all tests is to use
There is no mention there of using |
As recommended
lubridate
tests are intests/testthat
. From the documentation I infer that to manually run a test, I have to usetest_check
, but it fails:Confusingly
test_package("lubridate")
works.The text was updated successfully, but these errors were encountered: