Skip to content

Commit 8ef16cf

Browse files
authored
Fix redundant load_all() call in devtools::test() (#2436)
1 parent dd960cc commit 8ef16cf

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# devtools (development version)
22

3+
* `test()` no longer calls `load_all()` twice. `test_active_file()`
4+
now calls `load_all()` via testthat.
5+
36
* `aspell_env_var()` does a better job of matching R CMD check behaviour,
47
which is only to use `aspell`, not `hunspell` or `ispell` (#2376).
58

R/test.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ test <- function(pkg = ".", filter = NULL, stop_on_failure = FALSE, export_all =
3535
return(invisible())
3636
}
3737

38-
load_all(pkg$path)
39-
4038
cli::cli_inform(c(i = "Testing {.pkg {pkg$package}}"))
4139
withr::local_envvar(r_env_vars())
4240
testthat::test_local(
@@ -62,8 +60,7 @@ test_active_file <- function(file = find_active_file(), ...) {
6260
pkg <- as.package(path_dir(test_files)[[1]])
6361

6462
withr::local_envvar(r_env_vars())
65-
load_all(pkg$path, quiet = TRUE)
66-
testthat::test_file(test_files, ...)
63+
testthat::test_file(test_files, ..., load_package = "source")
6764
}
6865

6966
#' @param show_report Show the test coverage report.

0 commit comments

Comments
 (0)