Skip to content

Commit ba4ecd7

Browse files
authored
tests: activate partical match tests (#354)
* tests: activate partical match tests * ...
1 parent ad5febc commit ba4ecd7

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Imports:
3737
Suggests:
3838
DiceKriging,
3939
e1071,
40+
future,
4041
glmnet,
4142
kknn,
4243
knitr,

tests/testthat/setup.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
old_opts = options(
2+
warnPartialMatchArgs = TRUE,
3+
warnPartialMatchAttr = TRUE,
4+
warnPartialMatchDollar = TRUE
5+
)
6+
7+
# https://github.com/HenrikBengtsson/Wishlist-for-R/issues/88
8+
old_opts = lapply(old_opts, function(x) if (is.null(x)) FALSE else x)
9+
10+
lg = lgr::get_logger("mlr3")
11+
old_threshold = lg$threshold
12+
old_plan = future::plan()
13+
lg$set_threshold(0)
14+
future::plan("sequential")

tests/testthat/teardown.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
options(old_opts)
2+
lg = lgr::get_logger("mlr3")
3+
lg$set_threshold(old_threshold)
4+
future::plan(old_plan)

tests/testthat/test_regr_ranger.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test_that("quantile prediction", {
7878
learner$train(task)
7979
pred = learner$predict(task)
8080

81-
expect_matrix(pred$quantiles, ncol = 3L)
81+
expect_matrix(pred$quantiles, ncols = 3L)
8282
expect_true(!any(apply(pred$quantiles, 1L, is.unsorted)))
8383
expect_equal(pred$response, pred$quantiles[, 2L])
8484

0 commit comments

Comments
 (0)