Skip to content

Commit e7b04fc

Browse files
authored
Merge pull request #480 from cmu-delphi/testTsibblePatch
test grouping only before tsibble 1.1.5
2 parents 35c38a8 + 25c9bbc commit e7b04fc

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tests/testthat/test-as_tibble-decay.R

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ test_that("as_tibble checks an attr to avoid decay to tibble", {
88
})
99

1010
test_that("as_tibble ungroups if needed", {
11+
# tsibble is doing some method piracy, and overwriting as_tibble.grouped_df as of 1.1.5
12+
skip_if(packageVersion("tsibble") > "1.1.4")
1113
edf <- jhu_csse_daily_subset %>% group_by(geo_value)
1214
# removes the grouped_df class
1315
expect_identical(class(as_tibble(edf)), c("tbl_df", "tbl", "data.frame"))

tests/testthat/test-methods-epi_df.R

+12-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,18 @@ test_that("Correct metadata when subset includes some of other_keys", {
121121
# Including both original other_keys was already tested above
122122
})
123123

124-
test_that("Metadata and grouping are dropped by `as_tibble`", {
124+
test_that("Metadata is dropped by `as_tibble`", {
125+
grouped_converted <- toy_epi_df %>%
126+
group_by(geo_value) %>%
127+
as_tibble()
128+
expect_true(
129+
!any(c("metadata") %in% names(attributes(grouped_converted)))
130+
)
131+
})
132+
133+
test_that("Grouping are dropped by `as_tibble`", {
134+
# tsibble is doing some method piracy, and overwriting as_tibble.grouped_df as of 1.1.5
135+
skip_if(packageVersion("tsibble") > "1.1.4")
125136
grouped_converted <- toy_epi_df %>%
126137
group_by(geo_value) %>%
127138
as_tibble()

0 commit comments

Comments
 (0)