Skip to content

Commit

Permalink
Quiet db test
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored and jimhester committed Sep 8, 2021
1 parent 9750d7c commit 6db1a7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/db.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' unlink(db)
#' @export
with_db_connection <- function(con, code) {
requireNamespace("DBI")
requireNamespace("DBI", quietly = TRUE)

stopifnot(all(is.named(con)))
stopifnot(all(vlapply(con, methods::is, "DBIConnection")))
Expand All @@ -42,7 +42,7 @@ with_db_connection <- function(con, code) {
#' @rdname with_db_connection
#' @export
local_db_connection <- function(con, .local_envir = parent.frame()) {
requireNamespace("DBI")
requireNamespace("DBI", quietly = TRUE)
stopifnot(methods::is(con, "DBIConnection"))

defer(DBI::dbDisconnect(con), envir = .local_envir)
Expand Down

0 comments on commit 6db1a7b

Please sign in to comment.