Skip to content

Commit

Permalink
check that covr exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Jan 4, 2022
1 parent 1e1e491 commit 41e7f07
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions R-package/tests/testthat/test_lgb.unloader.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ VERBOSITY <- as.integer(
)

test_that("lgb.unloader works as expected", {
testthat::skip_if(
condition = covr::in_covr()
, message = "lgb.unloader() tests are skipped when calculating test coverage"
)
if (require(covr)) { # nolint
testthat::skip_if(
condition = covr::in_covr()
, message = "lgb.unloader() tests are skipped when calculating test coverage"
)
}
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
Expand All @@ -28,10 +30,12 @@ test_that("lgb.unloader works as expected", {
})

test_that("lgb.unloader finds all boosters and removes them", {
testthat::skip_if(
condition = covr::in_covr()
, message = "lgb.unloader() tests are skipped when calculating test coverage"
)
if (require(covr)) { # nolint
testthat::skip_if(
condition = covr::in_covr()
, message = "lgb.unloader() tests are skipped when calculating test coverage"
)
}
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
Expand Down

0 comments on commit 41e7f07

Please sign in to comment.