Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hbaniecki committed Feb 27, 2022
1 parent 91da18c commit 73740cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test_2_0.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ case4 <- testthat::expect_silent(
N = 5, B = 2, show_info = v)
)

testthat::expect_true(case4$x$options$is_target_binary)
testthat::expect_true(case4$x$options$is_target_binary)
14 changes: 8 additions & 6 deletions tests/testthat/test_warnings_and_errors.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ testthat::test_that("new_observation as list", {

if (requireNamespace("xgboost", quietly=TRUE)) {
testthat::test_that("check_single_prediction error", {
testthat::expect_error(
ms <- modelStudio::modelStudio(explainer_xgb,
new_observation = model_matrix_train[1,],
show_info = v, B = 3)
testthat::expect_warning(
testthat::expect_error(
ms <- modelStudio::modelStudio(explainer_xgb,
new_observation = model_matrix_train[1,],
show_info = v, B = 3)
)
)
})
}
Expand All @@ -37,8 +39,8 @@ testthat::test_that("removed modelStudioOptions", {
if (requireNamespace("ranger", quietly=TRUE)) {
ms <- modelStudio::modelStudio(explain_rf, apartments[1:2,], N = 5, B = 2, show_info = v)
new_ms <- modelStudio::ms_update_observations(ms, explain_rf, B = 2, show_info = v,
new_observation = apartments[1,],
new_observation_y = apartments$m2.price[1])
new_observation = apartments[3,],
new_observation_y = apartments$m2.price[3])

testthat::test_that("duplicated ids", {
testthat::expect_is(new_ms, "modelStudio")
Expand Down

0 comments on commit 73740cd

Please sign in to comment.