Skip to content

Commit 4d40ba6

Browse files
authored
Merge pull request #344 from MichaelChirico/patch-3
Skip some tests when missing Suggests
2 parents d523792 + 92e0441 commit 4d40ba6

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

tests/testthat/test-aesthetics.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ test_that("color_scheme_view returns correct ggplot object", {
135135
})
136136

137137
test_that("color_scheme_view returns gtable if length(scheme) >= 1", {
138+
skip_if_not_installed("gridExtra")
138139
expect_gtable(color_scheme_view(c("red", "gray")))
139140
expect_gtable(color_scheme_view(c("red", "gray", "blue")))
140141
})

tests/testthat/test-bayesplot_grid.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
library(bayesplot)
22
context("bayesplot_grid")
33

4+
skip_if_not_installed("gridExtra")
5+
46
y <- example_y_data()
57
yrep <- example_yrep_draws()[1:25, ]
68
gr <- gridExtra::arrangeGrob(ppc_stat(y, yrep, binwidth = 1))

tests/testthat/test-mcmc-scatter-and-parcoord.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ test_that("mcmc_hex throws error if number of parameters is not 2", {
6565

6666
# mcmc_pairs -------------------------------------------------------------
6767
test_that("mcmc_pairs returns a bayesplot_grid object", {
68+
skip_if_not_installed("gridExtra")
6869
g <- mcmc_pairs(arr, pars = c("(Intercept)", "sigma"))
6970
expect_bayesplot_grid(g)
7071
expect_equal(print(g), plot(g))
@@ -88,6 +89,7 @@ test_that("mcmc_pairs using hexbin works", {
8889
})
8990

9091
test_that("no mcmc_pairs non-NUTS 'condition's fail", {
92+
skip_if_not_installed("gridExtra")
9193
expect_bayesplot_grid(
9294
mcmc_pairs(arr, pars = "sigma", regex_pars = "beta",
9395
condition = pairs_condition(chains = list(1, 2:4)))

0 commit comments

Comments
 (0)