Skip to content

Commit

Permalink
test: Fix tests if DBItest is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Nov 8, 2023
1 parent de2f4d3 commit d0d6f42
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Suggests:
covr,
DBItest (>= 1.7.2.9001),
knitr,
rlang,
rmarkdown,
testthat (>= 3.0.0)
LinkingTo:
Expand Down
4 changes: 1 addition & 3 deletions tests/testthat/helper-DBItest.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
library(DBI)

DBItest::make_context(
if (rlang::is_installed("DBItest")) DBItest::make_context(
Postgres(),
NULL,
name = "RPostgres",
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-DBItest.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if (Sys.getenv("GITHUB_ACTIONS") == "true" || (postgresHasDefault() && identical(Sys.getenv("NOT_CRAN"), "true"))) {

DBItest::test_all()

if (rlang::is_installed("DBItest")) {
DBItest::test_all()
}
}

0 comments on commit d0d6f42

Please sign in to comment.