testthat
testthat copied to clipboard
Warning: 'Changing language has no effect when R installed without NLS'
I'm now seeing warnings in tests where I wasn't before:
Warning (test-types.R:12:3): TensorShapes are not converted to lists
Changing language has no effect when R installed without NLS
Backtrace:
1. testthat::expect_true(y[2] == shape(10))
at test-types.R:12:2
2. testthat:::expect_waldo_constant(act, TRUE, info = info)
3. testthat:::waldo_compare(...)
4. reporter$local_user_output()
5. testthat::local_reproducible_output(...)
6. withr::local_language(lang, .local_envir = .env)
The test is calling expect_true()
, which should behave the same regardless of language, I think.
I'm running testthat inside an R installation that was installed with --disable-nls and I found no way of disabling this warning and happens for every line I put in a test thanks to withr::local_language(lang, .local_envir = .env)
.
Is there a way disable this warning? My output becomes extremely noisy and hard to read after just a few tests.
I'm having the same issue. I'm using a fixed build container rocker/r-ver both for development and production, which is apparently built without native language support.
I'm seeing this as well with r-devel 81975 (4.2)
If local_reproducible_output()
we should only use local_language()
if capabilities("NLS")[[1]]
is TRUE
.