testthat icon indicating copy to clipboard operation
testthat copied to clipboard

Warning: 'Changing language has no effect when R installed without NLS'

Open t-kalinowski opened this issue 2 years ago • 4 comments

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.

t-kalinowski avatar Feb 09 '22 00:02 t-kalinowski

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.

fredheidrich-aurizon avatar Mar 07 '22 23:03 fredheidrich-aurizon

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.

bottervanger avatar Apr 08 '22 07:04 bottervanger

I'm seeing this as well with r-devel 81975 (4.2)

mjsteinbaugh avatar Apr 20 '22 15:04 mjsteinbaugh

If local_reproducible_output() we should only use local_language() if capabilities("NLS")[[1]] is TRUE.

hadley avatar Jul 25 '22 16:07 hadley