Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor database tests into individual test blocks #725

Merged
merged 11 commits into from
Jan 19, 2024
Merged

Conversation

hadley
Copy link
Member

@hadley hadley commented Jan 12, 2024

  • Add test_con() helper and move individual database tests into own blocks
  • Add local_table() helper

Fixes #634

@hadley hadley requested a review from detule January 12, 2024 22:29
Copy link
Collaborator

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High-key, this PR is a W.

Love the new helpers.🕺

tests/testthat/test-driver-oracle.R Outdated Show resolved Hide resolved
tests/testthat/test-driver-sql-server.R Show resolved Hide resolved
res <- dbGetQuery(con, "SELECT CAST(? AS date)", params = as.Date("2019-01-01"))
expect_equal(res[[1]], as.Date("2019-01-01"))
})
test_that("can parse SQL server identifiers", {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is pretty slick

@hadley hadley merged commit 384d15b into main Jan 19, 2024
16 checks passed
@hadley hadley deleted the test-refactoring branch January 19, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helpers to set up test connections
2 participants