diff --git a/tests/testthat/test-C5.R b/tests/testthat/test-C5.R index 264f044..cce914c 100644 --- a/tests/testthat/test-C5.R +++ b/tests/testthat/test-C5.R @@ -66,6 +66,7 @@ test_that('check model reduction', { # ------------------------------------------------------------------------------ test_that('check C5 parsnip interface', { + skip_if_not_installed("modeldata") set.seed(4779) expect_error( diff --git a/tests/testthat/test-cart.R b/tests/testthat/test-cart.R index 73918a2..54077d6 100644 --- a/tests/testthat/test-cart.R +++ b/tests/testthat/test-cart.R @@ -99,6 +99,8 @@ test_that('check model reduction', { # ------------------------------------------------------------------------------ test_that('check CART parsnip interface', { + skip_if_not_installed("modeldata") + set.seed(4779) expect_error( reg_mod <- bag_tree(cost_complexity = .001, min_n = 3) %>% @@ -204,6 +206,7 @@ test_that('mode specific package dependencies', { test_that('case weights', { skip_if_not_installed("modeldata") + data("two_class_dat", package = "modeldata") set.seed(1) wts <- runif(nrow(two_class_dat)) diff --git a/tests/testthat/test-mars.R b/tests/testthat/test-mars.R index 26f9e45..f6c94db 100644 --- a/tests/testthat/test-mars.R +++ b/tests/testthat/test-mars.R @@ -1,5 +1,7 @@ test_that('check mars opt', { skip_if_not_installed("earth") + skip_if_not_installed("modeldata") + set.seed(36323) check_pruning <- function(x, ...) { rlang::eval_tidy(x$call$pmethod) == "backward" @@ -91,6 +93,8 @@ test_that('check model reduction', { test_that('check MARS parsnip interface', { skip_if_not_installed("earth") + skip_if_not_installed("modeldata") + set.seed(4779) expect_error( reg_mod <- bag_mars(num_terms = 5, prod_degree = 2) %>% diff --git a/tests/testthat/test-nnet.R b/tests/testthat/test-nnet.R index cffc5fe..cbc8501 100644 --- a/tests/testthat/test-nnet.R +++ b/tests/testthat/test-nnet.R @@ -1,6 +1,8 @@ test_that('check nnet parsnip interface', { skip_if_not_installed("nnet") + skip_if_not_installed("modeldata") + data(two_class_dat, package = "modeldata") set.seed(4779) diff --git a/tests/testthat/test-validation.R b/tests/testthat/test-validation.R index ea8e505..a871251 100644 --- a/tests/testthat/test-validation.R +++ b/tests/testthat/test-validation.R @@ -88,6 +88,8 @@ test_that('validate imps', { test_that('bad inputs', { skip_if_not_installed("earth") + skip_if_not_installed("modeldata") + expect_error( bagger(mpg ~ ., data = mtcars, base_model = letters[1:2]), "should be a single character value."