Skip to content

Commit

Permalink
skip_if_not_installed("modeldata")
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Oct 15, 2024
1 parent 6b08f86 commit 4c8de18
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/testthat/test-C5.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-cart.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) %>%
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test-mars.R
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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) %>%
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-nnet.R
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-validation.R
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 4c8de18

Please sign in to comment.