Skip to content

Commit

Permalink
suppress rstanarm warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Feb 7, 2023
1 parent cda4def commit 155668c
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-plot.estimate_contrasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_that("`plot.see_estimate_contrasts()` works", {
skip_if_not_or_load_if_installed("emmeans")
skip_if_not(getRversion() >= "4.1")

model <- rstanarm::stan_glm(Sepal.Width ~ Species, data = iris, refresh = 0)
model <- stan_glm(Sepal.Width ~ Species, data = iris, refresh = 0)
contrasts <- modelbased::estimate_contrasts(model)
means <- modelbased::estimate_means(model)
expect_s3_class(plot(contrasts, means), "gg")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-plot.estimate_density.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_that("`plot.see_estimate_density()` works", {
skip_if_not_or_load_if_installed("ggridges")

set.seed(123)
m <<- stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)
m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
result <- bayestestR::estimate_density(m)
expect_s3_class(plot(result), "gg")
})
2 changes: 1 addition & 1 deletion tests/testthat/test-plot.hdi.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("`plot.see_hdi()` works", {
skip_if_not_or_load_if_installed("ggridges")

set.seed(123)
m <<- stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)
m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
result <- bayestestR::hdi(m)

expect_s3_class(plot(result), "gg")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-plot.p_direction.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("`plot.see_p_direction()` works", {
skip_if_not_or_load_if_installed("ggridges")

set.seed(123)
m <<- rstanarm::stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)
m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
result <- bayestestR::p_direction(m)

expect_s3_class(plot(result), "gg")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-plot.p_significance.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("`plot.see_p_significance()` works", {
skip_if_not_or_load_if_installed("ggridges")

set.seed(123)
m <<- stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)
m <<- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
result <- bayestestR::p_significance(m)

expect_s3_class(plot(result), "gg")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-plot.point_estimates.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
test_that("`plot.see_point_estimate()` works", {
skip_if_not_or_load_if_installed("rstanarm")
set.seed(123)
m <- stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)
m <- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
result <- bayestestR::point_estimate(m, centrality = "median")

expect_s3_class(plot(result), "ggplot")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-plot.rope.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
test_that("`plot.see_rope()` works", {
skip_if_not_or_load_if_installed("rstanarm")
set.seed(123)
m <- rstanarm::stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)
m <- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
result <- bayestestR::rope(m)

expect_s3_class(plot(result), "gg")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-plot.si.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("`plot.see_si()` works", {
skip_if_not_or_load_if_installed("logspline")

set.seed(123)
m <- stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0)
m <- suppressWarnings(stan_glm(Sepal.Length ~ Petal.Width * Species, data = iris, refresh = 0))
result <- bayestestR::si(m, verbose = FALSE)

expect_s3_class(plot(result), "gg")
Expand Down

0 comments on commit 155668c

Please sign in to comment.