Skip to content

Commit

Permalink
delete duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt committed Nov 8, 2024
1 parent f283b77 commit e361ae8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 34 deletions.
23 changes: 6 additions & 17 deletions tests/testthat/_snaps/embed.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
* `x3`
i This may cause errors when processing new data.

# bad args
# check_name() is used

Code
recipe(Species ~ ., data = three_class) %>% step_embed(Sepal.Length, outcome = vars(
Species)) %>% prep(training = three_class, retain = TRUE)
prep(rec, training = dat)
Condition
Error in `step_embed()`:
Caused by error in `prep()`:
x All columns selected for the step should be string, factor, or ordered.
* 1 double variable found: `Sepal.Length`
Caused by error in `bake()`:
! Name collision occurred. The following variable names already exist:
* `x3_embed_1`

---
# bad args

Code
recipe(~., data = mtcars) %>% step_embed(outcome = vars(mpg), num_terms = -4) %>%
Expand All @@ -49,16 +48,6 @@
Caused by error in `prep()`:
! `hidden_units` must be a whole number larger than or equal to 0, not the number -4.

# check_name() is used

Code
prep(rec, training = dat)
Condition
Error in `step_embed()`:
Caused by error in `bake()`:
! Name collision occurred. The following variable names already exist:
* `x3_embed_1`

# bake method errors when needed non-standard role columns are missing

Code
Expand Down
17 changes: 0 additions & 17 deletions tests/testthat/test-embed.R
Original file line number Diff line number Diff line change
Expand Up @@ -283,23 +283,6 @@ test_that("character encoded predictor", {
)
})

test_that("bad args", {
skip_on_cran()
skip_if_not_installed("keras")
skip_if(!embed:::is_tf_available())

three_class <- iris
three_class$fac <- rep(letters[1:3], 50)
three_class$logical <- rep(c(TRUE, FALSE), 75)

expect_snapshot(
error = TRUE,
recipe(Species ~ ., data = three_class) %>%
step_embed(Sepal.Length, outcome = vars(Species)) %>%
prep(training = three_class, retain = TRUE)
)
})

test_that("check_name() is used", {
skip_on_cran()
skip_if_not_installed("keras")
Expand Down

0 comments on commit e361ae8

Please sign in to comment.