diff --git a/tests/testthat/helper_expectations.R b/tests/testthat/helper_expectations.R index b4589e35..90bb34e7 100644 --- a/tests/testthat/helper_expectations.R +++ b/tests/testthat/helper_expectations.R @@ -1,24 +1,22 @@ expect_prediction_clust = function(p) { expect_prediction(p) - checkmate::expect_r6(p, "PredictionClust", + expect_r6(p, "PredictionClust", public = c("row_ids", "truth", "predict_types", "prob", "partition") ) - checkmate::expect_numeric(p$truth, any.missing = TRUE, len = length(p$row_ids), null.ok = TRUE) - checkmate::expect_numeric(p$partition, + expect_numeric(p$truth, any.missing = TRUE, len = length(p$row_ids), null.ok = TRUE) + expect_numeric(p$partition, any.missing = FALSE, len = length(p$row_ids), null.ok = TRUE ) if ("prob" %in% p$predict_types) { - checkmate::expect_matrix(p$prob, "numeric", any.missing = FALSE, nrows = length(p$row_ids)) + expect_matrix(p$prob, "numeric", any.missing = FALSE, nrows = length(p$row_ids)) } } -expect_task_clust = function(task) { - checkmate::expect_r6(task, "TaskClust") -} +expect_task_clust = function(task) expect_r6(task, "TaskClust") expect_prediction_complete = function(p, predict_type) { - expect_false(checkmate::anyMissing(p[[predict_type]])) + expect_false(anyMissing(p[[predict_type]])) } expect_prediction_exclusive = function(p, predict_type) { diff --git a/tests/testthat/test_mlr_learners_clust_ap.R b/tests/testthat/test_mlr_learners_clust_ap.R index 2071f692..54d3995d 100644 --- a/tests/testthat/test_mlr_learners_clust_ap.R +++ b/tests/testthat/test_mlr_learners_clust_ap.R @@ -24,7 +24,7 @@ test_that("Learner properties are respected", { parset = parset_list[[i]] learner$param_set$values = parset - suppressWarnings({p = learner$train(task)$predict(task)}) + p = suppressWarnings(learner$train(task)$predict(task)) expect_prediction_clust(p) if ("complete" %in% learner$properties) {