Skip to content

expect_error() is being used too much #1096

@EmilHvitfeldt

Description

@EmilHvitfeldt

as an example the following test https://github.com/tidymodels/parsnip/blob/main/tests/testthat/test_decision_tree.R#L15-L18

  expect_snapshot_error({
    bt <- decision_tree(cost_complexity = -1) %>% set_engine("rpart")
    fit(bt, class ~ ., hpc)
  })

is expected to test that cost_complexity isn’t good, but it instead tests that the mode isn’t set

#> Error in `fit()`:
#> ! Please set the mode in the model specification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    upkeepmaintenance, infrastructure, and similar

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions