Skip to content

Commit

Permalink
tests: remove checkmate namespace prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muecke committed Dec 3, 2024
1 parent 0c4c381 commit b8bb483
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions tests/testthat/helper_expectations.R
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_mlr_learners_clust_ap.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b8bb483

Please sign in to comment.