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
Consider suppressing deprecation warnings in expect_warning(, NA)
#1680
Comments
And in |
Maybe suppress only on CRAN? |
expect_warning(, NA)
expect_warning(, NA)
I don't think we need to because the deprecations will still bubble up in other tests (just not the tests where you're asserting there are no warnings). But I think we'd probably couple this with #1679, where we'd start to steer people away from saying there are no warnings whatsoever in favour of asserting there are no warnings of a specific type/message. |
Hmmmm, but there are advantages to just suppressing the warnings on CRAN: then we're guaranteeing that a deprecation will never break |
To me this feels more like a variation of |
We've determined this is actually but lifecycle's responsibility: r-lib/lifecycle#134 |
We've now decided this is not lifecycle's responsibility: r-lib/lifecycle#144 |
We've decided that it's simpler for lifecycle to be consistent, and generate deprecations regardless of where the code is run. So this means that testthat has to be a bit smarter, because we don't want a test like this: test_that("no warnings", {
expect_warning(foo(), NA)
} to fail just because The deprecation warnings are no longer captured by the catch all expectation like In most cases, we'll use soft deprecation in tidyverse packages which mean that users of your package won't see the warnings either. So all up, only developers who are actively working on the package will see them. This might be slightly too little pain (since if you're not actively developing your package, you might never see the deprecations), but I think we can address that problem separately, possibly by some additional tooling that lets us alert package developers via Github. |
Since this is causing revdep failures
The text was updated successfully, but these errors were encountered: