tests/testthat/helper-functions.R

skip_if_no_python_or_no_spacy <- function() {
  if (spacyr::find_spacy_env()) {
    return(NULL)
  }
  spacy_path <- spacyr::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 textrecipes package in your browser

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

textrecipes documentation built on Nov. 16, 2023, 5:06 p.m.