tests/testthat/helper-s3.R

expect_s3_class_tune_results <- function(x) {
  expect_s3_class(x, "tune_results")
}

expect_s3_class_bare_tibble <- function(x) {
  expect_s3_class(x, c("tbl_df", "tbl", "data.frame"), exact = TRUE)
}

# ------------------------------------------------------------------------------
# Test object used when testing vctrs/dplyr compatibility.
# Delayed assign to only load it in once.

load_helper_tune_results <- function() {
  list(
    resample = readRDS(test_path("data", "lm_resamples.rds")),
    tune = readRDS(test_path("data", "knn_results.rds")),
    bayes = readRDS(test_path("data", "lm_bayes.rds"))
  )
}

delayedAssign("helper_tune_results", load_helper_tune_results())

Try the tune package in your browser

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

tune documentation built on Aug. 24, 2023, 1:09 a.m.