Skip to content

Commit

Permalink
skip snapshots with glue() error on R 4.3.3+ (#210)
Browse files Browse the repository at this point in the history
* skip snapshots with `glue()` error on R 4.3.3+
* update snaps for survival/finetune
  • Loading branch information
simonpcouch authored Mar 4, 2024
1 parent d18eff2 commit 0398048
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
30 changes: 15 additions & 15 deletions tests/testthat/_snaps/survival-tune_race_anova.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
# A tibble: 5 x 6
cost_complexity .metric .eval_time mean n std_err
<dbl> <chr> <dbl> <dbl> <int> <dbl>
1 0.0000000001 brier_survival 1 0.177 30 0.00707
2 0.0841 brier_survival 1 0.201 30 0.00415
3 0.0891 brier_survival 1 0.201 30 0.00415
4 0.0944 brier_survival 1 0.201 30 0.00415
5 0.1 brier_survival 1 0.201 30 0.00415
1 0.0841 brier_survival 1 0.201 30 0.00415
2 0.0891 brier_survival 1 0.201 30 0.00415
3 0.0944 brier_survival 1 0.201 30 0.00415
4 0.1 brier_survival 1 0.201 30 0.00415
5 0.0794 brier_survival 1 0.202 30 0.00418

---

Expand All @@ -69,11 +69,11 @@
# A tibble: 5 x 6
cost_complexity .metric .eval_time mean n std_err
<dbl> <chr> <dbl> <dbl> <int> <dbl>
1 0.0000000001 brier_survival 1 0.177 30 0.00707
2 0.0841 brier_survival 1 0.201 30 0.00415
3 0.0891 brier_survival 1 0.201 30 0.00415
4 0.0944 brier_survival 1 0.201 30 0.00415
5 0.1 brier_survival 1 0.201 30 0.00415
1 0.0841 brier_survival 1 0.201 30 0.00415
2 0.0891 brier_survival 1 0.201 30 0.00415
3 0.0944 brier_survival 1 0.201 30 0.00415
4 0.1 brier_survival 1 0.201 30 0.00415
5 0.0794 brier_survival 1 0.202 30 0.00418

---

Expand All @@ -87,11 +87,11 @@
# A tibble: 5 x 6
cost_complexity .metric .eval_time mean n std_err
<dbl> <chr> <dbl> <dbl> <int> <dbl>
1 0.0000000001 brier_survival_integrated NA 0.285 30 0.00426
2 0.0794 brier_survival_integrated NA 0.338 30 0.00487
3 0.0841 brier_survival_integrated NA 0.338 30 0.00480
4 0.0891 brier_survival_integrated NA 0.338 30 0.00480
5 0.0944 brier_survival_integrated NA 0.338 30 0.00480
1 0.0794 brier_survival_integrated NA 0.338 30 0.00487
2 0.0841 brier_survival_integrated NA 0.338 30 0.00480
3 0.0891 brier_survival_integrated NA 0.338 30 0.00480
4 0.0944 brier_survival_integrated NA 0.338 30 0.00480
5 0.1 brier_survival_integrated NA 0.338 30 0.00480

# race tuning (anova) - unneeded eval_time

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-glmnet-linear.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ test_that('multi_predict() with default or single penalty value', {

test_that('error traps', {
skip_if_not_installed("glmnet")
skip_if_not_installed("parsnip", minimum_version = "1.2.0.9001")

expect_snapshot(error = TRUE, {
linear_reg(penalty = 0.01) %>%
Expand All @@ -277,7 +278,6 @@ test_that('error traps', {
set_engine("glmnet") %>%
fit(mpg ~ ., data = mtcars[-(1:4), ])
})
skip_if_not_installed("parsnip", minimum_version = "1.0.4.9003")
expect_snapshot(error = TRUE, {
linear_reg(penalty = 0.01) %>%
set_engine("glmnet") %>%
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-glmnet-logistic.R
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ test_that("class predictions are factors with all levels", {

test_that('error traps', {
skip_if_not_installed("glmnet")
skip_if_not_installed("parsnip", minimum_version = "1.2.0.9001")

data("lending_club", package = "modeldata", envir = rlang::current_env())

Expand All @@ -393,7 +394,6 @@ test_that('error traps', {
fit(Class ~ log(funded_amnt) + int_rate + term,
data = lending_club)
})
skip_if_not_installed("parsnip", minimum_version = "1.0.4.9003")
expect_snapshot(error = TRUE, {
logistic_reg(penalty = 0.01) %>%
set_engine("glmnet") %>%
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-glmnet-multinom.R
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ test_that("class predictions are factors with all levels", {

test_that('error traps', {
skip_if_not_installed("glmnet")
skip_if_not_installed("parsnip", minimum_version = "1.2.0.9001")

data("hpc_data", package = "modeldata", envir = rlang::current_env())

Expand All @@ -413,7 +414,6 @@ test_that('error traps', {
set_engine("glmnet") %>%
fit(class ~ ., data = hpc_data)
})
skip_if_not_installed("parsnip", minimum_version = "1.0.4.9003")
expect_snapshot(error = TRUE, {
multinom_reg(penalty = 0.01) %>%
set_engine("glmnet") %>%
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-glmnet-poisson.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ test_that("model errors on missing penalty value", {

test_that("predict() errors with multiple penalty values", {
skip_if_not_installed("glmnet")
skip_if_not_installed("parsnip", minimum_version = "1.2.0.9001")

skip_if_not_installed("poissonreg", minimum_version = "1.0.1.9000")
expect_snapshot(error = TRUE, {
Expand Down

0 comments on commit 0398048

Please sign in to comment.