Skip to content

Commit 9145e15

Browse files
committed
fix test, revise tests
1 parent 758e3c0 commit 9145e15

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

tests/testthat/test-icc.R

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
skip_on_os("mac")
2+
skip_on_cran()
23

34
test_that("icc", {
4-
skip_on_cran()
55
m0 <- lm(Sepal.Length ~ Petal.Length, data = iris)
66
expect_warning(expect_null(icc(m0)))
77
})
88

99
test_that("icc", {
10-
skip_on_cran()
1110
skip_if_not_installed("lme4")
1211
m1 <- lme4::lmer(Sepal.Length ~ Petal.Length + (1 | Species), data = iris)
1312
expect_equal(
@@ -25,7 +24,6 @@ test_that("icc", {
2524
# bootstrapped CIs ------------
2625

2726
test_that("icc, CI", {
28-
skip_on_cran()
2927
skip_if_not_installed("lme4")
3028
data(sleepstudy, package = "lme4")
3129
m <- lme4::lmer(Reaction ~ Days + (1 + Days | Subject), data = sleepstudy)
@@ -37,7 +35,6 @@ test_that("icc, CI", {
3735

3836

3937
test_that("icc", {
40-
skip_on_cran()
4138
skip_if_not_installed("curl")
4239
skip_if_offline()
4340
skip_if_not_installed("httr2")
@@ -54,7 +51,6 @@ test_that("icc", {
5451
})
5552

5653
test_that("icc", {
57-
skip_on_cran()
5854
skip_if_not_installed("curl")
5955
skip_if_offline()
6056
skip_if_not_installed("httr2")
@@ -68,7 +64,6 @@ test_that("icc", {
6864
})
6965

7066
test_that("icc", {
71-
skip_on_cran()
7267
skip_if_not_installed("curl")
7368
skip_if_offline()
7469
skip_if_not_installed("httr2")
@@ -86,7 +81,6 @@ test_that("icc", {
8681
})
8782

8883
test_that("icc", {
89-
skip_on_cran()
9084
skip_if_not_installed("lme4")
9185
data(sleepstudy, package = "lme4")
9286
set.seed(12345)
@@ -117,7 +111,6 @@ test_that("icc", {
117111

118112

119113
test_that("icc", {
120-
skip_on_cran()
121114
skip_if_not_installed("nlme")
122115
skip_if_not_installed("lme4")
123116
m <- nlme::lme(Sepal.Length ~ Petal.Length, random = ~ 1 | Species, data = iris)
@@ -128,7 +121,6 @@ test_that("icc", {
128121

129122

130123
test_that("icc, glmmTMB 1.1.9+", {
131-
skip_on_cran()
132124
skip_if_not_installed("glmmTMB", minimum_version = "1.1.9")
133125
set.seed(101)
134126
dd <- data.frame(

tests/testthat/test-model_performance.bayesian.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
skip_on_cran()
2+
skip_if_not_installed("rstanarm")
3+
skip_if_not_installed("rstantools")
4+
15
test_that("model_performance.stanreg", {
2-
skip_on_cran()
36
skip_if_not_installed("curl")
47
skip_if_offline()
58
skip_if_not_installed("httr2")
@@ -24,14 +27,13 @@ test_that("model_performance.stanreg", {
2427
skip_if(is.null(model))
2528
perf <- model_performance(model)
2629

27-
expect_equal(perf$R2, 0.6286546, tolerance = 1e-3)
28-
expect_equal(perf$R2_adjusted, 0.6053507, tolerance = 1e-3)
30+
expect_equal(perf$R2, 0.642, tolerance = 1e-3)
31+
expect_equal(perf$R2_adjusted, 0.6053454, tolerance = 1e-3)
2932
expect_equal(perf$ELPD, -31.55849, tolerance = 1e-3)
3033
})
3134

3235

3336
test_that("model_performance.brmsfit", {
34-
skip_on_cran()
3537
skip_if_not_installed("curl")
3638
skip_if_offline()
3739
skip_if_not_installed("httr2")
@@ -72,7 +74,6 @@ test_that("model_performance.brmsfit", {
7274

7375

7476
test_that("model_performance.BFBayesFactor", {
75-
skip_on_cran()
7677
skip_if_not_installed("BayesFactor")
7778
mod <- BayesFactor::ttestBF(mtcars$wt, mu = 3)
7879
expect_warning({

tests/testthat/test-r2_bayes.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ test_that("r2_BayesFactor", {
3232

3333
test_that("r2_bayes", {
3434
skip_on_cran()
35+
skip_if_not_installed("curl")
36+
skip_if_offline()
37+
skip_if_not_installed("httr2")
3538
skip_if_not_installed("rstanarm")
3639
skip_if_not_installed("rstantools")
37-
skip_if_not_installed("httr2")
3840
model <- insight::download_model("stanreg_lmerMod_1")
3941
set.seed(123)
4042
out <- r2_bayes(model)

0 commit comments

Comments
 (0)