Skip to content

Commit

Permalink
address misc testthat 3e warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Oct 21, 2024
1 parent d4fc1d1 commit 7128251
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/test-cmprsk.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ test_that("tidy.cmprsk", {
td3 %>%
dplyr::select(conf.low, conf.high) %>%
unclass() %>%
unname(),
unname()
)
})
2 changes: 1 addition & 1 deletion tests/testthat/test-emmeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ test_that("tidy.ref.grid consistency with tidy.TukeyHSD", {

expect_equal(
as.data.frame(td_hsd),
as.data.frame(td_pairs),
as.data.frame(td_pairs)
)
})

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-glmnetUtils.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ test_that("tidy.glmnet.formula", {
check_tidy_output(td2)
check_tidy_output(td2z)

expect_is(td2, "tbl_df")
expect_s3_class(td2, "tbl_df")

expect_equal(dim(td2), c(1511L, 6L))
expect_equal(dim(td2z), c(2000L, 6L))
Expand All @@ -75,6 +75,6 @@ test_that("glance.glmnet.formula", {

check_glance_outputs(gl, gl2)

expect_is(gl, "tbl_df")
expect_s3_class(gl, "tbl_df")
expect_equal(dim(gl), c(1L, 3L))
})
2 changes: 1 addition & 1 deletion tests/testthat/test-mass-polr.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test_that("augment.polr", {
)

au <- augment(fit, type.predict = "class")
expect_is(au$.fitted, "factor")
expect_s3_class(au$.fitted, "factor")
expect_equal(predict(fit, type = "class"), au$.fitted)
})

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-multcomp.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ test_that("tidy.glht consistency with tidy.TukeyHSD", {
expect_equal(
as.data.frame(td_hsd),
as.data.frame(td_glht),
check.attributes = FALSE,
ignore_attr = TRUE,
tolerance = 0.001
)
})
2 changes: 1 addition & 1 deletion tests/testthat/test-stats-mlm.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ df_tidy <- tidy(fit_mlm, conf.int = TRUE)

test_that("tidy.mlm works", {
expect_equal(dim(df_tidy), c(4L, 8L))
expect_is(df_tidy, "tbl_df")
expect_s3_class(df_tidy, "tbl_df")
})

#' helper function: replicate each element of x
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-stats-prcomp.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ test_that("augment.prcomp works with matrix objects", {
expect_equal(dim(df1), c(1000L, 15L))
expect_equal(dim(df2), c(1000L, 47L))
testthat::expect_equal(tibble::as_tibble(pred), df1[, -1])
expect_is(df1, "tbl_df")
expect_s3_class(df1, "tbl_df")
})

0 comments on commit 7128251

Please sign in to comment.