From 8e8477521b46ad781821c6bda1ec6f0b930857b3 Mon Sep 17 00:00:00 2001 From: Damonamajor Date: Mon, 27 Apr 2026 15:30:09 +0000 Subject: [PATCH 1/6] update testthat --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index c1d9747..751a174 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,9 +43,10 @@ Suggests: rsample, scales, snakecase, - testthat (>= 2.1.0), + testthat (>= 3.0.0), tidyr, tune, workflows, yardstick RoxygenNote: 7.2.3 +Config/testthat/edition: 3 From 04d54d48cc6f7fc80cde8cc93923ce25bd29e1f0 Mon Sep 17 00:00:00 2001 From: Damonamajor Date: Mon, 27 Apr 2026 17:23:52 +0000 Subject: [PATCH 2/6] remove context --- tests/testthat/test-early_stopping.R | 2 -- tests/testthat/test-helpers.R | 4 ---- tests/testthat/test-hyperparameters.R | 2 -- tests/testthat/test-lightgbm.R | 4 ---- 4 files changed, 12 deletions(-) diff --git a/tests/testthat/test-early_stopping.R b/tests/testthat/test-early_stopping.R index 741a0b6..0a61e05 100644 --- a/tests/testthat/test-early_stopping.R +++ b/tests/testthat/test-early_stopping.R @@ -1,5 +1,3 @@ -context("test early stopping") - test_that("validation uses correct dimensions", { expect_error( reg_fit <- diff --git a/tests/testthat/test-helpers.R b/tests/testthat/test-helpers.R index c193b42..4c60997 100644 --- a/tests/testthat/test-helpers.R +++ b/tests/testthat/test-helpers.R @@ -1,5 +1,3 @@ -context("test axe_tune_data()") - ##### TEST axe_tune_data() ##### axe_test_data <- dplyr::tibble( @@ -20,8 +18,6 @@ test_that("invalid data types stop process", { }) -context("test axe_recipe()") - ##### TEST axe_recipe() ##### iris_recp <- recipes::recipe( diff --git a/tests/testthat/test-hyperparameters.R b/tests/testthat/test-hyperparameters.R index 16fd3af..24b791e 100644 --- a/tests/testthat/test-hyperparameters.R +++ b/tests/testthat/test-hyperparameters.R @@ -1,5 +1,3 @@ -context("test hyperparameters") - model <- parsnip::boost_tree() %>% parsnip::set_mode("regression") diff --git a/tests/testthat/test-lightgbm.R b/tests/testthat/test-lightgbm.R index dd39493..0896475 100644 --- a/tests/testthat/test-lightgbm.R +++ b/tests/testthat/test-lightgbm.R @@ -1,5 +1,3 @@ -context("test lightgbm regression") - test_that("lightgbm regression", { model <- parsnip::boost_tree(trees = 50) %>% parsnip::set_engine( @@ -123,8 +121,6 @@ test_that("lighgbm throws error", { }) -context("test tune") - test_that("lightgbm with tune", { model <- parsnip::boost_tree( trees = tune::tune() From 5da2213a9b3002a96c5454c79c1bb37dd0ac8f7c Mon Sep 17 00:00:00 2001 From: Damonamajor Date: Mon, 27 Apr 2026 18:40:11 +0000 Subject: [PATCH 3/6] one more context --- tests/testthat/test-helpers.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/testthat/test-helpers.R b/tests/testthat/test-helpers.R index 4c60997..a83e1e3 100644 --- a/tests/testthat/test-helpers.R +++ b/tests/testthat/test-helpers.R @@ -39,8 +39,6 @@ test_that("invalid data types stop process", { }) -context("test lgbm_save() and lgbm_load()") - ##### TEST lgbm_save() and lgbm_load() ##### library(modeldata) From 24b825e200dc7dc04a21c134edc232e8d9173088 Mon Sep 17 00:00:00 2001 From: Damonamajor <56321109+Damonamajor@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:34:40 -0500 Subject: [PATCH 4/6] Update test-helpers.R --- tests/testthat/test-helpers.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-helpers.R b/tests/testthat/test-helpers.R index a83e1e3..4654586 100644 --- a/tests/testthat/test-helpers.R +++ b/tests/testthat/test-helpers.R @@ -8,8 +8,8 @@ axe_test_data <- dplyr::tibble( # Test for expected outputs test_that("output is as expected", { - expect_equivalent(axe_tune_data(axe_test_data), axe_test_data[, 1:2]) -}) + expect_equal(axe_tune_data(axe_test_data), axe_test_data[, 1:2], ignore_attr = TRUE) +})}) # Test that invalid inputs throw errors test_that("invalid data types stop process", { From 7f87e3306adff3980fe91c066a178a0db9c0f2f2 Mon Sep 17 00:00:00 2001 From: Damonamajor <56321109+Damonamajor@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:38:24 -0500 Subject: [PATCH 5/6] Update helper-lightgbm.R --- tests/testthat/helper-lightgbm.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/helper-lightgbm.R b/tests/testthat/helper-lightgbm.R index aac56e9..0f1335a 100644 --- a/tests/testthat/helper-lightgbm.R +++ b/tests/testthat/helper-lightgbm.R @@ -102,7 +102,7 @@ expect_can_tune_boost_tree <- function(model) { expect_true(all(!is.nan(tune::collect_metrics(adj)$mean))) final <- model %>% - tune::finalize_model(tune::select_best(adj)) %>% + tune::finalize_model(tune::select_best(adj, metric = "rmse")) %>% parsnip::set_mode("regression") %>% parsnip::fit(mpg ~ ., mtcars) From 3c986467ab18f11c11ac5fa0928547f69752da29 Mon Sep 17 00:00:00 2001 From: Damonamajor <56321109+Damonamajor@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:42:17 -0500 Subject: [PATCH 6/6] Update test-helpers.R --- tests/testthat/test-helpers.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-helpers.R b/tests/testthat/test-helpers.R index 4654586..3b2d94f 100644 --- a/tests/testthat/test-helpers.R +++ b/tests/testthat/test-helpers.R @@ -8,8 +8,12 @@ axe_test_data <- dplyr::tibble( # Test for expected outputs test_that("output is as expected", { - expect_equal(axe_tune_data(axe_test_data), axe_test_data[, 1:2], ignore_attr = TRUE) -})}) + expect_equal( + axe_tune_data(axe_test_data), + axe_test_data[, 1:2], + ignore_attr = TRUE + ) +}) # Test that invalid inputs throw errors test_that("invalid data types stop process", {