Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions r/tests/testthat/helper-skip.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,16 @@ skip_on_python_older_than <- function(python_version) {
return()
}

if (!reticulate::py_available(initialize = TRUE)) {
# We want to be careful not to initialize reticulate in this helper function
config <- reticulate::py_discover_config()

# It isn't documented, but config should be NULL when py_discovery_config()
# fails to find a valid Python installation
if (is.null(config)) {
skip("Python isn't available")
}

if (reticulate::py_version() < python_version) {
if (config$version < python_version) {
skip(paste("Python version:", reticulate::py_version()))
}
}
Expand Down
Loading