Skip to content

Commit

Permalink
Merge pull request #997 from tidymodels/quiet-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt authored Aug 10, 2023
2 parents 40ec24f + b4f6db9 commit e6cd72f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/engines.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ load_libs <- function(x, quiet, attach = FALSE) {
if (!attach) {
suppressPackageStartupMessages(requireNamespace(pkg, quietly = quiet))
} else {
library(pkg, character.only = TRUE)
library(pkg, character.only = TRUE, quietly = quiet)
}
}
invisible(x)
Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test_grouped_glm.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
library(tidyr)

test_that('correct results for glm_grouped()', {
ucb_weighted <- as.data.frame(UCBAdmissions)
ucb_weighted$Freq <- as.integer(ucb_weighted$Freq)

ucb_long <- uncount(ucb_weighted, Freq)
ucb_long <- tidyr::uncount(ucb_weighted, Freq)

ungrouped <- glm(Admit ~ Gender + Dept, data = ucb_long, family = binomial)

expect_error(
grouped <- glm_grouped(Admit ~ Gender + Dept, data = ucb_weighted, weights = ucb_weighted$Freq),
regexp = NA
)
expect_equal(grouped$df.null, 11)

expect_equal(grouped$df.null, 11)
})

0 comments on commit e6cd72f

Please sign in to comment.