Skip to content

Commit

Permalink
transition from expect_message()
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Oct 21, 2024
1 parent babe435 commit 70f6256
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
7 changes: 7 additions & 0 deletions tests/testthat/_snaps/ergm.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@
Warning in `tidy.ergm()`:
Exponentiating but model didn't use log or logit link.

# glance.ergm

Code
gl3 <- glance(gest, deviance = TRUE, mcmc = TRUE)
Message
Though `glance` was supplied `mcmc = TRUE`, the model was not fittedusing MCMC, so the corresponding columns will be omitted.

7 changes: 7 additions & 0 deletions tests/testthat/_snaps/stats-htest.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# tidy.htest/oneway.test

Code
td <- tidy(ot)
Message
Multiple parameters; naming those columns num.df, den.df

# augment.htest (chi squared test)

Code
Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test-ergm.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ test_that("tidy.ergm", {
test_that("glance.ergm", {
gl <- glance(gest, deviance = TRUE)
gl2 <- glance(gest3, deviance = TRUE, mcmc = TRUE)
expect_message(
gl3 <- glance(gest, deviance = TRUE, mcmc = TRUE)
)

expect_snapshot(gl3 <- glance(gest, deviance = TRUE, mcmc = TRUE))

check_glance_outputs(gl)
check_dims(gl, expected_cols = 9)
check_dims(gl2, expected_cols = 12)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-stats-htest.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test_that("tidy.htest same as glance.htest", {
test_that("tidy.htest/oneway.test", {
mtcars$cyl <- as.factor(mtcars$cyl)
ot <- oneway.test(mpg ~ cyl, mtcars)
expect_message(td <- tidy(ot))
expect_snapshot(td <- tidy(ot))
gl <- glance(ot)

check_tidy_output(td)
Expand Down

0 comments on commit 70f6256

Please sign in to comment.