Skip to content

Commit

Permalink
Merge pull request #416 from r-dbi/testthat-3e
Browse files Browse the repository at this point in the history
test: `use_testthat(3)`
  • Loading branch information
aviator-app[bot] authored Nov 8, 2023
2 parents 7048fae + e1e37ab commit 7d6454e
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 17 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Suggests:
rmarkdown,
rprojroot,
RSQLite (>= 1.1-2),
testthat,
testthat (>= 3.0.0),
vctrs,
xml2
VignetteBuilder:
Expand Down Expand Up @@ -70,3 +70,4 @@ Config/Needs/website:
sergeant,
sparklyr,
withr
Config/testthat/edition: 3
10 changes: 10 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# 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/testing-design.html#sec-tests-files-overview
# * https://testthat.r-lib.org/articles/special-files.html

library(testthat)
library(DBI)

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

test_that("write arrow to sqlite", {
skip_if_not_installed("nanoarrow")
skip_if_not_installed("RSQLite")
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")

test_that("dbDataType works on a data frame", {
df <- data.frame(x = 1:10, y = runif(10))
types <- dbDataType(MockDriver(), df)
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-interpolate.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("sqlInterpolate")

test_that("parameter names matched", {
expect_equal(
sqlInterpolate(ANSI(), "?a ?b", a = 1, b = 2),
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-methods.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("methods")

expect_ellipsis <- function(name, method) {
sym <- as.name(name)
eval(bquote({
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-quote.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("quote")

test_that("identifier", {
expect_equal(dbQuoteIdentifier(ANSI(), character()), SQL(character()))
expect_equal(dbQuoteIdentifier(ANSI(), "a"), SQL('"a"'))
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-quoting.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("Quoting")

test_that("NA becomes NULL", {
expect_equal(dbQuoteString(ANSI(), NA_character_), SQL("NULL"))
})
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-rownames.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
context("Rowname translation")

test_that("logical row names uses default name", {
df <- data.frame(x = c(a = 1))

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

test_that("NAs turn in NULLs", {
df <- data.frame(
x = c(1, NA),
Expand Down

0 comments on commit 7d6454e

Please sign in to comment.