tests/testthat/utils.R

skip_if_no_python_or_no_spacy <- function() {
    if (find_spacy_env()) return(NULL)
    spacy_path <- find_spacy(ask = FALSE)
    if (is.null(spacy_path)) {
        testthat::skip("Skip the test as spaCy is not found")
    } else if (is.na(spacy_path)) {
        testthat::skip("Skip the test as python is not found")
    }
}

Try the spacyr package in your browser

Any scripts or data that you put into this service are public.

spacyr documentation built on March 26, 2020, 5:25 p.m.