Skip to content

Commit

Permalink
Directly test version in skip_if_not_installed() (#469)
Browse files Browse the repository at this point in the history
* Directly test version in skip_if_not_installed()

* one more in test_Tuner.R
  • Loading branch information
MichaelChirico authored Nov 22, 2024
1 parent 4b6c958 commit b21a0ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions tests/testthat/test_AutoTuner.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ test_that("AutoTuner works with graphlearner", {
})

test_that("Nested resampling works with graphlearner", {
skip_if_not_installed("mlr3pipelines")
skip_if(packageVersion("mlr3pipelines") < "0.5.3")
skip_if_not_installed("mlr3pipelines", "0.5.3")
requireNamespace("mlr3pipelines")

gl = MAKE_GL()
Expand Down Expand Up @@ -275,8 +274,7 @@ test_that("search space from TuneToken works", {
})

test_that("AutoTuner get_base_learner method works", {
skip_if_not_installed("mlr3pipelines")
skip_if(packageVersion("mlr3pipelines") < "0.5.3")
skip_if_not_installed("mlr3pipelines", "0.5.3")
requireNamespace("mlr3pipelines")

# simple learner
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test_Tuner.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ test_that("proper error when primary search space is empty", {
})

test_that("internal tuning: branching", {
skip_if_not_installed("mlr3pipelines")
skip_if(packageVersion("mlr3pipelines") < "0.5.3")
skip_if_not_installed("mlr3pipelines", "0.5.3")
# this case is special, because not all internally tuned parameters are present in every iteration, only those that
# are in the active branch are
glrn = mlr3pipelines::ppl("branch", graphs = list(
Expand Down

0 comments on commit b21a0ad

Please sign in to comment.