Skip to content

Commit

Permalink
[R-package] add assertions to test on lightgbm() weights (#5110)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Mar 31, 2022
1 parent 60244e4 commit 3ed0027
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R-package/tests/testthat/test_basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -2941,6 +2941,7 @@ test_that("lightgbm() accepts 'weight' and 'weights'", {
, nrounds = 5L
, verbose = -1L
)
expect_equal(model$.__enclos_env__$private$train_set$get_field("weight"), w)

# Avoid a bad CRAN check due to partial argument matches
lgb_args <- list(
Expand All @@ -2952,4 +2953,5 @@ test_that("lightgbm() accepts 'weight' and 'weights'", {
, verbose = -1L
)
model <- do.call(lightgbm, lgb_args)
expect_equal(model$.__enclos_env__$private$train_set$get_field("weight"), w)
})

0 comments on commit 3ed0027

Please sign in to comment.