Skip to content

Commit 73740cd

Browse files
committed
fix test
1 parent 91da18c commit 73740cd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

tests/testthat/test_2_0.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ case4 <- testthat::expect_silent(
9595
N = 5, B = 2, show_info = v)
9696
)
9797

98-
testthat::expect_true(case4$x$options$is_target_binary)
98+
testthat::expect_true(case4$x$options$is_target_binary)

tests/testthat/test_warnings_and_errors.R

+8-6
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ testthat::test_that("new_observation as list", {
1212

1313
if (requireNamespace("xgboost", quietly=TRUE)) {
1414
testthat::test_that("check_single_prediction error", {
15-
testthat::expect_error(
16-
ms <- modelStudio::modelStudio(explainer_xgb,
17-
new_observation = model_matrix_train[1,],
18-
show_info = v, B = 3)
15+
testthat::expect_warning(
16+
testthat::expect_error(
17+
ms <- modelStudio::modelStudio(explainer_xgb,
18+
new_observation = model_matrix_train[1,],
19+
show_info = v, B = 3)
20+
)
1921
)
2022
})
2123
}
@@ -37,8 +39,8 @@ testthat::test_that("removed modelStudioOptions", {
3739
if (requireNamespace("ranger", quietly=TRUE)) {
3840
ms <- modelStudio::modelStudio(explain_rf, apartments[1:2,], N = 5, B = 2, show_info = v)
3941
new_ms <- modelStudio::ms_update_observations(ms, explain_rf, B = 2, show_info = v,
40-
new_observation = apartments[1,],
41-
new_observation_y = apartments$m2.price[1])
42+
new_observation = apartments[3,],
43+
new_observation_y = apartments$m2.price[3])
4244

4345
testthat::test_that("duplicated ids", {
4446
testthat::expect_is(new_ms, "modelStudio")

0 commit comments

Comments
 (0)