Skip to content

Commit a206166

Browse files
authored
Merge pull request #958 from mlr-org/fix_testthat_dev
Make tests compatable with upcoming `testthat` version
2 parents 63024eb + f230bd4 commit a206166

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# mlr3pipelines 0.9.0-9000
22

3+
* Compatibility with new testthat version 3.3.0
34
* Fix: Added internal workaround for `PipeOpNMF` attaching `Biobase`, `BiocGenerics`, and `generics` to the search path during training, prediction or when printing its `$state`.
4-
* feat: allow dates in datefeatures pipe op and use data.table for date feature generation
5+
* feat: allow dates in datefeatures pipe op and use data.table for date feature generation.
56
* Added support for internal validation tasks to `PipeOpFeatureUnion`.
67

78
# mlr3pipelines 0.9.0

tests/testthat/test_Graph.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ test_that("assert_graph test", {
225225

226226
gr2 = assert_graph(gr)
227227

228-
expect_error(expect_deep_clone(gr, gr2), class = "error", regexp = "addresses differ.*isn't true|addresses differ.*is not TRUE")
228+
expect_error(expect_deep_clone(gr, gr2), class = "error",
229+
regexp = "Expected.*addresses differ.*to be TRUE|addresses differ.*isn't true|addresses differ.*is not TRUE")
229230

230231
gr2 = as_graph(gr, clone = TRUE)
231232

@@ -237,7 +238,8 @@ test_that("assert_graph test", {
237238

238239
po = PipeOpNOP$new()
239240

240-
expect_error(expect_deep_clone(po, po), class = "error", regexp = "addresses differ.*isn't true|addresses differ.*is not TRUE")
241+
expect_error(expect_deep_clone(po, po), class = "error",
242+
regexp = "Expected.*addresses differ.*to be TRUE|addresses differ.*isn't true|addresses differ.*is not TRUE")
241243

242244
po2 = as_graph(po, clone = TRUE)$pipeops[[1]]
243245

tests/testthat/test_meta.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ context("meta")
55
test_that("expect_deep_clone catches non-deep clones", {
66
po = PipeOpDebugBasic$new()
77

8-
expect_error(expect_deep_clone(po, po)) # can't use expect_failure for some reason
8+
expect_condition(expect_deep_clone(po, po), class = "expectation_failure")
99
po1 = po$clone(deep = TRUE)
1010
expect_deep_clone(po, po1)
1111
po1$state = 1
12-
expect_failure(expect_deep_clone(po, po1))
12+
expect_condition(expect_deep_clone(po, po1), class = "expectation_failure")
1313

1414
po$state = 1
1515
expect_deep_clone(po, po1)

0 commit comments

Comments
 (0)