Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Imports:
Suggests:
callr,
covr,
DBItest (>= 1.7.1),
DBItest (>= 1.7.2.9001),
knitr,
rmarkdown,
testthat
testthat (>= 3.0.0)
LinkingTo:
plogr (>= 0.2.0),
Rcpp
Expand Down Expand Up @@ -116,3 +116,6 @@ Collate:
'utils.R'
Config/autostyle/scope: line_breaks
Config/autostyle/strict: false
Config/testthat/edition: 3
Remotes:
r-dbi/DBItest
8 changes: 8 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/tests.html
# * https://testthat.r-lib.org/reference/test_package.html#special-files

library(testthat)
library(RPostgres)

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-bigint.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("bigint")

test_that("integer", {
con <- postgresDefault(bigint = "integer")
on.exit(dbDisconnect(con))
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-checkInterrupts.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("checkInterrupts")

test_that("check_interrupts = TRUE works with queries < 1 second", {
con <- postgresDefault(check_interrupts = TRUE)
time <- system.time(
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-data-type.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("dbDataType")

# Taken from DBI
test_that("dbDataType works on a data frame", {
con <- postgresDefault()
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-dbConnect.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("Connection")

test_that("querying closed connection throws error", {
db <- postgresDefault()
dbDisconnect(db)
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-dbGetQuery.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("dbGetQuery")

test_that("special characters work", {
con <- postgresDefault()

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-dbQuoteIdentifier.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("dbQuoteIdentifier")

test_that("quoting string", {
con <- postgresDefault()

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-dbWriteTable.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("dbWriteTable")

if (postgresHasDefault()) {

with_database_connection({
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-encoding.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("Encoding")

# Specific to RPostgres
test_that("NAs encoded as NULLs", {
expect_equal(encode_vector(NA), "\\N")
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-isTransacting.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("isTransacting")

test_that("isTransacting detects transactions correctly", {
skip_on_cran()
con <- postgresDefault()
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-transactions.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("transactions")

test_that("autocommit", {
skip_on_cran()
con <- postgresDefault()
Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test-types.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
context("exotic types")

test_that("can manipulate classes", {
expect_is(set_class(1, "A"), "A")
expect_s3_class(set_class(1, "A"), "A")
})

test_that("dbColumnInfo() knows about typnames", {
Expand All @@ -12,7 +10,7 @@ test_that("dbColumnInfo() knows about typnames", {
expect_equal(dbColumnInfo(rs)[[".typname"]], c("int4", "json"))

res <- dbFetch(rs)
expect_is(res$js, "pq_json")
expect_s3_class(res$js, "pq_json")

dbClearResult(rs)
})
2 changes: 0 additions & 2 deletions tests/testthat/test-waitForNotify.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("waitForNotify")

test_that("WaitForNotify without anything to do returns NULL", {
db <- postgresDefault()
n <- RPostgres::postgresWaitForNotify(db, 1)
Expand Down