diff --git a/tests/testthat/test-broom.R b/tests/testthat/test-broom.R index 3f29c95..fe98bc2 100644 --- a/tests/testthat/test-broom.R +++ b/tests/testthat/test-broom.R @@ -165,8 +165,7 @@ test_that("augment fails if it can't preprocess `new_data`", { wf <- fit(wf, df) - # vctrs type error - expect_error(augment(wf, new_data)) + expect_error(augment(wf, new_data), class = "vctrs_error_cast") }) test_that("augment works with matrix compositions (#148)", { diff --git a/tests/testthat/test-pre-action-case-weights.R b/tests/testthat/test-pre-action-case-weights.R index 04e5615..3b88f8f 100644 --- a/tests/testthat/test-pre-action-case-weights.R +++ b/tests/testthat/test-pre-action-case-weights.R @@ -478,8 +478,7 @@ test_that("case weights `col` must exist in `data`", { wf <- add_formula(wf, mpg ~ .) wf <- add_case_weights(wf, foo) - # Tidyselect error - expect_error(fit(wf, mtcars)) + expect_error(fit(wf, mtcars), class = "vctrs_error_subscript_oob") }) test_that("case weights `col` can't select >1 columns in `data`", { diff --git a/tests/testthat/test-pre-action-variables.R b/tests/testthat/test-pre-action-variables.R index 18cec54..495f6a2 100644 --- a/tests/testthat/test-pre-action-variables.R +++ b/tests/testthat/test-pre-action-variables.R @@ -168,8 +168,7 @@ test_that("`outcomes` are removed from set of possible `predictors` (#72)", { workflow2 <- add_variables(workflow, mpg, mpg) - # vctrs subscript error - expect_error(.fit_pre(workflow2, mtcars)) + expect_error(.fit_pre(workflow2, mtcars), class = "vctrs_error_subscript_oob") }) test_that("selecting no `outcomes` doesn't break selection of `predictors`", { diff --git a/tests/testthat/test-predict.R b/tests/testthat/test-predict.R index c216040..f548d8a 100644 --- a/tests/testthat/test-predict.R +++ b/tests/testthat/test-predict.R @@ -120,8 +120,9 @@ test_that("blueprint will get passed on to hardhat::forge()", { mod1 <- fit(workflow1, train) mod2 <- fit(workflow2, train) + # Warning from hardhat, so we don't snapshot it expect_warning(pred1 <- predict(mod1, test)) - expect_warning(pred2 <- predict(mod2, test), NA) + expect_no_warning(pred2 <- predict(mod2, test)) expect_identical( pred1[[".pred"]],