From 9d1c7197bc6419bf898a377eef0f4ba9a8302490 Mon Sep 17 00:00:00 2001 From: olivroy <52606734+olivroy@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:50:39 -0500 Subject: [PATCH 1/4] Add purrr --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index b7029b251..fdbe90755 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -28,6 +28,7 @@ Imports: pkgdown (>= 2.0.6), pkgload (>= 1.3.0), profvis (>= 0.3.7), + purrr (>= 1.0.0), rcmdcheck (>= 1.4.0), remotes (>= 2.4.2), rlang (>= 1.0.4), From 1e3a23c0a76df887a89ab8c53334cfc64f22a787 Mon Sep 17 00:00:00 2001 From: olivroy <52606734+olivroy@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:52:34 -0500 Subject: [PATCH 2/4] Use `purrr::walk()` to get better error message --- R/run-examples.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/run-examples.R b/R/run-examples.R index cfc87fd72..8cfc74ba5 100644 --- a/R/run-examples.R +++ b/R/run-examples.R @@ -65,7 +65,7 @@ run_examples <- function(pkg = ".", start = NULL, show = deprecated(), run_dontt load_all(pkg$path, reset = TRUE, export_all = FALSE) on.exit(load_all(pkg$path, reset = TRUE)) - lapply(files, pkgload::run_example, run_donttest = run_donttest, run_dontrun = run_dontrun) + purrr::walk(files, function(x) pkgload::run_example(x, run_donttest = run_donttest, run_dontrun = run_dontrun)) invisible() } From 705228a58c6e624dcdf9aba0b92fe99c9a336ad5 Mon Sep 17 00:00:00 2001 From: olivroy <52606734+olivroy@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:57:59 -0500 Subject: [PATCH 3/4] Set local interactive = FALSE --- R/run-examples.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/run-examples.R b/R/run-examples.R index 8cfc74ba5..d840a0acd 100644 --- a/R/run-examples.R +++ b/R/run-examples.R @@ -37,6 +37,7 @@ run_examples <- function(pkg = ".", start = NULL, show = deprecated(), run_dontt if (!missing(show)) { lifecycle::deprecate_warn("2.3.1", "run_examples(show)") } + rlang::local_interactive(FALSE) pkg <- as.package(pkg) From 9485220ad370f187a26b01abf40afc62ce6e2d81 Mon Sep 17 00:00:00 2001 From: olivroy <52606734+olivroy@users.noreply.github.com> Date: Thu, 15 Feb 2024 20:00:13 -0500 Subject: [PATCH 4/4] No need for dev testthat --- DESCRIPTION | 2 -- 1 file changed, 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index fdbe90755..b84d0b374 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -63,8 +63,6 @@ Suggests: spelling (>= 2.2) VignetteBuilder: knitr -Remotes: - r-lib/testthat Config/Needs/website: tidyverse/tidytemplate Config/testthat/edition: 3 Encoding: UTF-8