-
Notifications
You must be signed in to change notification settings - Fork 340
Description
I'm new to R and just started with testthat, using it to run tests again a package I'm writing. My tests themselves run fine, but RStudio is yellow-squiggle underlining all the functions from both testthat and my package with the message no symbol named 'expect_true' in scope for example (example image below).
This is really annoying and I have a "no warnings" mindset when it comes to code so I would like to fix them properly without affecting "genuine" warnings in the tests. I am aware of the RStudio "Warn if variable used has no definition in scope" option but would prefer not to disable it.
I have I already tried:
- Adding a .lintr file to the package root:
linters: with_defaults(
object_usage_linter = NULL
)
exclusions: list("tests/testthat")
- Confirming that both testthat and my package are in tests/testthat.R:
library(MyPackage)
test_check("MyPackage")
3 Adding export(is_valid_time) to the NAMESPACE file at the package root, which would not solve the testthat calls, but I thought might at least solve the calls into my package functions.
None of these changed the RStudio behaviour (I restarted RStudio to make sure it picked up these changes).
I realise this could be an issue/question more about RStudio than testthat itself, but I'm guessing the problem is that testthat does imports in a way that RStudio can't pick up on or something similar. So I thought this might be the best place to ask.
