Skip to content

Commit

Permalink
tests: move to testthat3 (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muecke authored Feb 4, 2024
1 parent 25f607b commit 59c3805
Show file tree
Hide file tree
Showing 25 changed files with 2 additions and 49 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Suggests:
mclust,
mlbench,
RWeka,
testthat
testthat (>= 3.0.0)
Encoding: UTF-8
Roxygen: list(markdown = TRUE, r6 = TRUE)
RoxygenNote: 7.2.3
Expand Down Expand Up @@ -80,3 +80,4 @@ Collate:
'bibentries.R'
'helper.R'
'zzz.R'
Config/testthat/edition: 3
2 changes: 0 additions & 2 deletions tests/testthat/test_LearnerClust.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("LearnerClust")

test_that("predict on newdata works / clust", {
task = tsk("usarrests")$filter(1:40)
learner = lrn("clust.featureless")
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_MeasureClust.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("MeasureClust")

test_that("Cluster measures", {
keys = mlr_measures$keys("clust")
task = tsk("usarrests")
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_PredictionClust.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("PredictionClust")

test_that("Construction", {
task = tsk("usarrests")
p = PredictionClust$new(row_ids = task$row_ids, partition = rep.int(1L, nrow(task$data())))
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_TaskClust.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("TaskClust")

test_that("Basic ops on usarrests task", {
task = tsk("usarrests")
expect_task(task)
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_agnes.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.agnes")

skip_if_not_installed("clue")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_ap.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.ap")

skip_if_not_installed("apcluster")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_cmeans.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.cmeans")

skip_if_not_installed("e1071")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_cobweb.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.cobweb")

skip_if_not_installed("RWeka")
skip_on_cran()

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_dbscan.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.dbscan")

skip_if_not_installed("dbscan")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_dbscan_fpc.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.dbscan_fpc")

skip_if_not_installed("fpc")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_diana.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.diana")

skip_if_not_installed("clue")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_em.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.em")

skip_if_not_installed("RWeka")
skip_on_cran()

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_fanny.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.fanny")

skip_if_not_installed("clue")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_featureless.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("mlr_learners_clust_featureless")

test_that("autotest", {
learner = lrn("clust.featureless")
expect_learner(learner)
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_ff.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.ff")

skip_if_not_installed("RWeka")
skip_on_cran()

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_hclust.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.hclust")

test_that("autotest", {
learner = mlr3::lrn("clust.hclust")
expect_learner(learner)
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_kkmeans.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.kkmeans")

skip_if_not_installed("kernlab")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_kmeans.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.kmeans")

skip_if_not_installed("clue")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_mbatchkmeans.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.MBatchKMeans")

skip_if_not_installed("ClusterR")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_mclust.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.mclust")

skip_if_not_installed("mclust")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_meanshift.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.meanshift")

skip_if_not_installed("LPCM")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_pam.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.pam")

skip_if_not_installed("clue")

test_that("autotest", {
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_simplekmeans.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.SimpleKMeans")

skip_if_not_installed("RWeka")
skip_on_cran()

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test_mlr_learners_clust_xmeans.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("clust.xmeans")

skip_on_cran()
skip_if_not_installed("RWeka")

Expand Down

0 comments on commit 59c3805

Please sign in to comment.