Skip to content

Commit

Permalink
fix lightgbm testing order
Browse files Browse the repository at this point in the history
  • Loading branch information
nhejazi committed Apr 22, 2021
1 parent 0444902 commit ad43f25
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions man/Lrnr_haldensify.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions tests/testthat/test-lightgbm.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ test_learner <- function(learner, task, ...) {
# test learner prediction
test_that("Learner can generate training set predictions", {
skip_on_os("windows")
fit_obj <- learner_obj$train(task)
train_preds <- fit_obj$predict()
expect_equal(
sl3:::safe_dim(train_preds)[1], length(task$Y)
Expand All @@ -33,11 +34,15 @@ test_learner <- function(learner, task, ...) {
# test learner chaining
test_that("Chaining returns a task", {
skip_on_os("windows")
fit_obj <- learner_obj$train(task)
chained_task <- fit_obj$chain()
expect_true(is(chained_task, "sl3_Task"))
})

test_that("Chaining returns the correct number of rows", {
skip_on_os("windows")
fit_obj <- learner_obj$train(task)
chained_task <- fit_obj$chain()
expect_equal(nrow(chained_task$X), nrow(task$X))
})
}
Expand Down

0 comments on commit ad43f25

Please sign in to comment.