Skip to content

Commit 1e7ad50

Browse files
Disable R_FUTURE_PLAN when checking examples
1 parent ef911bf commit 1e7ad50

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

R/zzz.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ attr(multicore, "backend") <- MulticoreFutureBackend
2020
update_package_option("future.debug", mode = "logical")
2121
debug <- isTRUE(getOption("future.debug"))
2222

23+
## Special case: Disable 'R_FUTURE_PLAN' when 'R CMD check'
24+
## runs checks on examples, because, for instance,
25+
## R_FUTURE_PLAN=multisession, will create connections that
26+
## the check code will think are left over connections.
27+
if (!is.na(Sys.getenv("R_FUTURE_PLAN")) && "CheckExEnv" %in% search()) {
28+
Sys.unsetenv("R_FUTURE_PLAN")
29+
}
30+
2331
if (debug) {
2432
envs <- Sys.getenv()
2533
envs <- envs[grep("R_FUTURE_", names(envs), fixed = TRUE)]

0 commit comments

Comments
 (0)