diff --git a/NEWS.md b/NEWS.md index 7bfbde3ed..ae96944b1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # devtools 1.13.3.9000 +* `test()` now sets `useFancyQuotes = FALSE` to better mimic the environment tests + are run under with `R CMD check` (#1735). + * `test_file()` and `test_coverage_file()` now have RStudio addins (#1650) * `test()` no longer passes encoding argument to `testthat::test_dir()` (#1776) diff --git a/R/test.r b/R/test.r index 849b0a0c9..fdc3cc9ba 100644 --- a/R/test.r +++ b/R/test.r @@ -68,8 +68,11 @@ test <- function(pkg = ".", filter = NULL, ...) { testthat_args <- c(testthat_args, load_helpers = FALSE) } - withr::with_envvar(r_env_vars(), - do.call(testthat::test_dir, testthat_args)) + withr::with_options(c(useFancyQuotes = FALSE), + withr::with_envvar(r_env_vars(), + do.call(testthat::test_dir, testthat_args) + ) + ) } #' @export