Skip to content

Commit 690a00f

Browse files
authored
Clone task in tests
1 parent 51adc0b commit 690a00f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/testthat/test_pipeop_task_preproc.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ test_that("PipeOpTaskPreproc - fix for #864 works", {
5050
task = mlr_tasks$get("iris")
5151
task$col_roles$order = "Petal.Width"
5252

53-
train_out = po$train(list(task))[[1L]]
53+
train_out = po$train(list(task$clone(deep = TRUE)))[[1L]]
5454
expect_equal(train_out$col_roles, task$col_roles)
5555

56-
predict_out = po$predict(list(task))[[1L]]
56+
predict_out = po$predict(list(task$clone(deep = TRUE)))[[1L]]
5757
expect_equal(predict_out$col_roles, task$col_roles)
5858
})

0 commit comments

Comments
 (0)