Skip to content

Commit 0fbcfd3

Browse files
committed
remove tests for base R error (closes #1193)
1 parent 6ebdab4 commit 0fbcfd3

16 files changed

+12
-125
lines changed

tests/testthat/_snaps/boost_tree.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@
3838
parsnip::xgb_train(x = missing_arg(), y = missing_arg(), weights = missing_arg(),
3939
nthread = 1, verbose = 0)
4040

41-
---
42-
43-
Code
44-
translate(boost_tree(formula = y ~ x))
45-
Condition
46-
Error in `boost_tree()`:
47-
! unused argument (formula = y ~ x)
48-
4941
# check_args() works
5042

5143
Code

tests/testthat/_snaps/decision_tree.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
Message
3535
Used `engine = 'rpart'` for translation.
3636

37-
---
38-
39-
unused argument (formula = y ~ x)
40-
4137
# argument checks for data dimensions
4238

4339
Code

tests/testthat/_snaps/linear_reg.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,30 +40,6 @@
4040
Error in `translate.default()`:
4141
! Please set an engine.
4242

43-
---
44-
45-
Code
46-
translate(linear_reg(formula = y ~ x))
47-
Condition
48-
Error in `linear_reg()`:
49-
! unused argument (formula = y ~ x)
50-
51-
---
52-
53-
Code
54-
translate(linear_reg(x = hpc[, 1:3], y = hpc$class) %>% set_engine("glmnet"))
55-
Condition
56-
Error in `linear_reg()`:
57-
! unused arguments (x = hpc[, 1:3], y = hpc$class)
58-
59-
---
60-
61-
Code
62-
translate(linear_reg(formula = y ~ x) %>% set_engine("lm"))
63-
Condition
64-
Error in `linear_reg()`:
65-
! unused argument (formula = y ~ x)
66-
6743
# lm execution
6844

6945
Code

tests/testthat/_snaps/logistic_reg.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,6 @@
2323
Error in `logistic_reg()`:
2424
! "regression" is not a known mode for model `logistic_reg()`.
2525

26-
---
27-
28-
Code
29-
translate(logistic_reg(formula = y ~ x))
30-
Condition
31-
Error in `logistic_reg()`:
32-
! unused argument (formula = y ~ x)
33-
34-
---
35-
36-
Code
37-
translate(logistic_reg(x = hpc[, 1:3], y = hpc$class) %>% set_engine(engine = "glmnet"))
38-
Condition
39-
Error in `logistic_reg()`:
40-
! unused arguments (x = hpc[, 1:3], y = hpc$class)
41-
42-
---
43-
44-
Code
45-
translate(logistic_reg(formula = y ~ x) %>% set_engine(engine = "glm"))
46-
Condition
47-
Error in `logistic_reg()`:
48-
! unused argument (formula = y ~ x)
49-
5026
---
5127

5228
Code

tests/testthat/_snaps/mars.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@
3131
x Engine "wat?" is not supported for `mars()`
3232
i See `show_engines("mars")`.
3333

34-
---
35-
36-
Code
37-
translate(mars(formula = y ~ x))
38-
Condition
39-
Error in `mars()`:
40-
! unused argument (formula = y ~ x)
41-
4234
# mars execution
4335

4436
Code

tests/testthat/_snaps/mlp.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,6 @@
5151
nnet::nnet(formula = missing_arg(), data = missing_arg(), size = 5,
5252
trace = FALSE, linout = TRUE)
5353

54-
---
55-
56-
Code
57-
translate(mlp(mode = "classification", x = x, y = y) %>% set_engine("keras"))
58-
Condition
59-
Error in `mlp()`:
60-
! unused arguments (x = x, y = y)
61-
62-
---
63-
64-
Code
65-
translate(mlp(mode = "regression", formula = y ~ x) %>% set_engine())
66-
Condition
67-
Error in `mlp()`:
68-
! unused argument (formula = y ~ x)
69-
7054
# check_args() works
7155

7256
Code

tests/testthat/_snaps/nullmodel.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515
x Engine "wat?" is not supported for `null_model()`
1616
i See `show_engines("null_model")`.
1717

18-
---
19-
20-
Code
21-
translate(null_model(formula = y ~ x))
22-
Condition
23-
Error in `null_model()`:
24-
! unused argument (formula = y ~ x)
25-
2618
---
2719

2820
Code

tests/testthat/_snaps/rand_forest.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,3 @@
3939
x Engine "wat?" is not supported for `rand_forest()`
4040
i See `show_engines("rand_forest")`.
4141

42-
---
43-
44-
Code
45-
translate(rand_forest(mode = "classification", ytest = 2))
46-
Condition
47-
Error in `rand_forest()`:
48-
! unused argument (ytest = 2)
49-

tests/testthat/test-boost_tree.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ test_that('updating', {
1313
test_that('bad input', {
1414
expect_snapshot(error = TRUE, boost_tree(mode = "bogus"))
1515
expect_snapshot(translate(boost_tree(mode = "classification"), engine = NULL))
16-
expect_snapshot(error = TRUE, translate(boost_tree(formula = y ~ x)))
1716
})
1817

1918

@@ -49,20 +48,20 @@ test_that('boost_tree can be fit with 1 predictor if validation is used', {
4948

5049
test_that("check_args() works", {
5150
skip_if_not_installed("xgboost")
52-
51+
5352
expect_snapshot(
5453
error = TRUE,
5554
{
56-
spec <- boost_tree(trees = -1) %>%
57-
set_engine("xgboost") %>%
55+
spec <- boost_tree(trees = -1) %>%
56+
set_engine("xgboost") %>%
5857
set_mode("classification")
5958
fit(spec, class ~ ., hpc)
6059
}
6160
)
6261
expect_snapshot(
6362
error = TRUE,
6463
{
65-
spec <- boost_tree(sample_size = -10) %>%
64+
spec <- boost_tree(sample_size = -10) %>%
6665
set_engine("xgboost") %>%
6766
set_mode("classification")
6867
fit(spec, class ~ ., hpc)
@@ -71,7 +70,7 @@ test_that("check_args() works", {
7170
expect_snapshot(
7271
error = TRUE,
7372
{
74-
spec <- boost_tree(tree_depth = -10) %>%
73+
spec <- boost_tree(tree_depth = -10) %>%
7574
set_engine("xgboost") %>%
7675
set_mode("classification")
7776
fit(spec, class ~ ., hpc)
@@ -80,7 +79,7 @@ test_that("check_args() works", {
8079
expect_snapshot(
8180
error = TRUE,
8281
{
83-
spec <- boost_tree(min_n = -10) %>%
82+
spec <- boost_tree(min_n = -10) %>%
8483
set_engine("xgboost") %>%
8584
set_mode("classification")
8685
fit(spec, class ~ ., hpc)

tests/testthat/test-decision_tree.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ test_that('bad input', {
2323
expect_snapshot(
2424
try(translate(decision_tree(), engine = NULL), silent = TRUE)
2525
)
26-
expect_snapshot_error(translate(decision_tree(formula = y ~ x)))
2726
})
2827

2928
test_that('rpart_train is stop-deprecated when it ought to be (#1044)', {

0 commit comments

Comments
 (0)