From 236119e1eb391c1f092c12ac48d0d58da381d568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Skytte=20Randl=C3=B8v?= Date: Thu, 22 Feb 2024 13:46:42 +0100 Subject: [PATCH] fix(helper-setup): Remove invalid connections --- testthat/helper-setup.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testthat/helper-setup.R b/testthat/helper-setup.R index a3751c98..cafe3d9b 100644 --- a/testthat/helper-setup.R +++ b/testthat/helper-setup.R @@ -105,10 +105,11 @@ get_test_conns <- function() { # Open connections test_conns <- names(conn_list) |> purrr::map(~ do.call(get_driver, c(list(x = purrr::pluck(conn_list, .)), purrr::pluck(conn_args, .)))) |> - stats::setNames(names(conn_list)) + stats::setNames(names(conn_list)) |> + purrr::discard(is.null) # Run post_connect commands on the connections - purrr::walk2(test_conns, names(conn_list), + purrr::walk2(test_conns, names(test_conns), \(conn, conn_name) purrr::walk(purrr::pluck(conn_post_connect, conn_name), ~ DBI::dbExecute(conn, .)))