Skip to content

Commit 005ef6a

Browse files
committed
skip tests on CRAN
New note on Debian win-builder CRAN test machine: ``` * checking tests ... [8s/3s] NOTE Running ‘testthat.R’ [8s/3s] Running R code in ‘testthat.R’ had CPU time 2.7 times elapsed time ```
1 parent 1f362ec commit 005ef6a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/testthat.R

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11

22
run <- function() {
3-
3+
4+
on_cran <- !isTRUE(as.logical(Sys.getenv("NOT_CRAN", "false")))
5+
if (on_cran) {
6+
message("env var 'NOT_CRAN=true' not defined; Skipping tests on CRAN")
7+
return()
8+
}
9+
410
if (!requireNamespace("testthat", quietly = TRUE)) {
511
message("'testthat' package not available; tests cannot be run")
612
return()
713
}
8-
14+
915
options(error = traceback)
1016
if (requireNamespace("rlang", quietly = TRUE))
1117
options(error = rlang::trace_back)
12-
18+
1319
library(testthat)
1420
library(reticulate)
15-
21+
1622
test_check("reticulate")
17-
23+
1824
}
1925

2026
run()

0 commit comments

Comments
 (0)