Skip to content

Commit 6fd7872

Browse files
committed
try check.environment=FALSE in more tests
1 parent 93a603d commit 6fd7872

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

tests/testthat/test-convenience-functions.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,3 @@ test_that("overlay_function returns the correct object", {
188188
check.environment = FALSE
189189
)
190190
})
191-
192-

tests/testthat/test-pp_check.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ test_that("default pp_check method works", {
88

99
expect_equal(
1010
pp_check(y, yrep[1:50, ], ppc_dens_overlay),
11-
ppc_dens_overlay(y, yrep[1:50, ])
11+
ppc_dens_overlay(y, yrep[1:50, ]),
12+
check.environment = FALSE
1213
)
1314
expect_equal(
1415
pp_check(y, yrep, fun = "stat_grouped", group = g, stat = "median"),
15-
ppc_stat_grouped(y, yrep, group = g, stat = "median")
16+
ppc_stat_grouped(y, yrep, group = g, stat = "median"),
17+
check.environment = FALSE
1618
)
1719
})
1820

tests/testthat/test-ppc-errors.R

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ test_that("ppc_error_scatter_avg returns ggplot2 object", {
2626
})
2727

2828
test_that("ppc_error_scatter_avg same as ppc_error_scatter if nrow(yrep) = 1", {
29-
expect_equal(ppc_error_scatter_avg(y2, yrep2),
30-
ppc_error_scatter(y2, yrep2))
31-
expect_equal(ppc_error_scatter_avg(y, yrep[1,, drop=FALSE]),
32-
ppc_error_scatter(y, yrep[1,, drop = FALSE]))
29+
expect_equal(
30+
ppc_error_scatter_avg(y2, yrep2),
31+
ppc_error_scatter(y2, yrep2),
32+
check.environment = FALSE
33+
)
34+
expect_equal(
35+
ppc_error_scatter_avg(y, yrep[1,, drop=FALSE]),
36+
ppc_error_scatter(y, yrep[1,, drop = FALSE]),
37+
check.environment = FALSE
38+
)
3339
})
3440

3541
test_that("ppc_error_scatter_avg_vs_x returns ggplot2 object", {

tests/testthat/test-ppc-scatterplots.R

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ test_that("ppc_scatter_avg returns ggplot object", {
1515
})
1616

1717
test_that("ppc_scatter_avg same as ppc_scatter if nrow(yrep) = 1", {
18-
expect_equal(ppc_scatter_avg(y2, yrep2),
19-
ppc_scatter(y2, yrep2))
20-
expect_equal(ppc_scatter_avg(y, yrep[1,, drop=FALSE]),
21-
ppc_scatter(y, yrep[1,, drop = FALSE]))
18+
expect_equal(
19+
ppc_scatter_avg(y2, yrep2),
20+
ppc_scatter(y2, yrep2),
21+
check.environment = FALSE
22+
)
23+
expect_equal(
24+
ppc_scatter_avg(y, yrep[1,, drop=FALSE]),
25+
ppc_scatter(y, yrep[1,, drop = FALSE]),
26+
check.environment = FALSE
27+
)
2228
})
2329

2430
test_that("ppc_scatter_avg_grouped returns a ggplot object", {

0 commit comments

Comments
 (0)