Skip to content

Commit 9eb9fb9

Browse files
committed
new tests
1 parent feb77c5 commit 9eb9fb9

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- {os: windows-latest, r: '4.0'}
4646
- {os: windows-latest, r: '3.6'}
4747
# - {os: windows-latest, r: '3.5'}
48+
- {os: ubuntu-16.04, r: '4.1', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
4849
- {os: ubuntu-16.04, r: '4.0', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
4950
- {os: ubuntu-16.04, r: '3.6', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
5051
# - {os: ubuntu-16.04, r: '3.5', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

tests/testthat/test_3_0.R

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
context("Test v3.0.0")
2+
3+
set.seed(1313)
4+
v <- FALSE
5+
6+
model <- glm(survived ~., data = DALEX::titanic_imputed, family = "binomial")
7+
8+
explainer <- DALEX::explain(model,
9+
data = DALEX::titanic_imputed,
10+
y = DALEX::titanic_imputed$survived,
11+
verbose = v)
12+
13+
testthat::test_that("N_sv, verbose parameters", {
14+
ms1 <- testthat::expect_silent(
15+
modelStudio::modelStudio(explainer,
16+
N_sv = 200, B = 2,
17+
verbose = v)
18+
)
19+
testthat::expect_is(ms1, "r2d3")
20+
})

tests/testthat/test_modelStudio.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ms_readme <- testthat::expect_silent(modelStudio::modelStudio(explain_titanic_g
2828
new_observations,
2929
facet_dim = c(2,2),
3030
N = N, B = B, time = 0,
31-
verbose = v))
31+
show_info = v))
3232

3333
ms_rf_apartments <- testthat::expect_silent(modelStudio::modelStudio(explain_rf,
3434
new_observation = apartments[1:2,-1],

tests/testthat/test_warnings_and_errors.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ if (requireNamespace("xgboost", quietly=TRUE)) {
2727
# ms <- modelStudio::modelStudioOptions()
2828
# )
2929
# })
30+
testthat::test_that("removed modelStudioOptions", {
31+
testthat::expect_error(
32+
ms <- modelStudio::modelStudioOptions()
33+
)
34+
})
35+
3036

3137
if (requireNamespace("ranger", quietly=TRUE)) {
3238
ms <- modelStudio::modelStudio(explain_rf, apartments[1:2,], N = 5, B = 2, show_info = v)

0 commit comments

Comments
 (0)