Skip to content

Commit

Permalink
skip tests on CRAN
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
t-kalinowski committed Sep 11, 2023
1 parent 1f362ec commit 005ef6a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@

run <- function() {


on_cran <- !isTRUE(as.logical(Sys.getenv("NOT_CRAN", "false")))
if (on_cran) {
message("env var 'NOT_CRAN=true' not defined; Skipping tests on CRAN")
return()
}

if (!requireNamespace("testthat", quietly = TRUE)) {
message("'testthat' package not available; tests cannot be run")
return()
}

options(error = traceback)
if (requireNamespace("rlang", quietly = TRUE))
options(error = rlang::trace_back)

library(testthat)
library(reticulate)

test_check("reticulate")

}

run()

0 comments on commit 005ef6a

Please sign in to comment.