Skip to content

Commit

Permalink
fix(r/adbcsqlite): Fix incomplete cleanup in adbcsqlite tests (#1219)
Browse files Browse the repository at this point in the history
Closes #1211.

It wasn't an external pointer issue, it was just not cleaning up
properly in some tests. These tests were written before `with_adbc()`
and `local_adbc()`...the tests for all the drivers could be refactored
to use them (but perhaps not today).
  • Loading branch information
paleolimbot authored Oct 23, 2023
1 parent 126235b commit 80f87b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions r/adbcsqlite/tests/testthat/test-adbcsqlite-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ test_that("read/write/execute SQL work with sqlite connections", {

stream <- adbcdrivermanager::read_adbc(con, "SELECT * from df")
expect_identical(as.data.frame(stream), data.frame(x = as.double(3:12)))

stream$release()
adbcdrivermanager::adbc_connection_release(con)
adbcdrivermanager::adbc_database_release(db)
})

test_that("write_adbc() with temporary = TRUE works with sqlite databases", {
Expand All @@ -118,4 +121,7 @@ test_that("write_adbc() with temporary = TRUE works with sqlite databases", {
adbcdrivermanager::read_adbc(con, "SELECT * from df"),
class = "adbc_status_invalid_argument"
)

adbcdrivermanager::adbc_connection_release(con)
adbcdrivermanager::adbc_database_release(db)
})

0 comments on commit 80f87b3

Please sign in to comment.