Skip to content

Commit e9741d1

Browse files
authored
Don't call library(rgenoud) in tests (#426)
1 parent 318fc8c commit e9741d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/testthat/test_mbo_km.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ test_that("mbo works with km", {
4242
ctrl = setMBOControlTermination(ctrl, iters = 5L)
4343
ctrl = setMBOControlInfill(ctrl, crit = crit.ei,
4444
opt.focussearch.points = 100L)
45-
# expect no output at all for show.info = FALSE
46-
library("rgenoud")
47-
expect_silent({or = mbo(f, des, control = ctrl, show.info = FALSE)})
45+
# FIXME: We need suppressPackageStartupMessages to suppress rgenoud startup message, as messages are not cought yet by mlr https://github.com/mlr-org/mlr/pull/2273
46+
47+
expect_silent(suppressPackageStartupMessages({or = mbo(f, des, control = ctrl, show.info = FALSE)}))
4848
expect_number(or$y)
4949
expect_equal(getOptPathLength(or$opt.path), 15)
5050
df = as.data.frame(or$opt.path)

vignettes/mlrMBO.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ library(mlrMBO)
5353

5454
1. Define **objective function** and its parameters using the package `smoof`.
5555
2. Generate **initial design** (optional).
56-
3. Define mlr` learner for **surrogate model** (optional).
56+
3. Define `mlr` learner for **surrogate model** (optional).
5757
4. Set up a **MBO control** object.
5858
5. Start the optimization with `mbo()`.
5959

0 commit comments

Comments
 (0)