Skip to content

Commit

Permalink
disconnect as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Tmonster committed Apr 4, 2024
1 parent 16249eb commit 3bb53c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/testthat/test-readonly.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ test_that("read_only flag does not throw error when rel_sql is called", {
ans <- data.frame(cyl=c(4), disp=c(71.1))
expect_rel2 <- duckdb:::rel_sql(rel, "SELECT cyl, disp FROM _ where disp = 71.1")
expect_equivalent(expect_rel2, ans)
dbDisconnect(con)
})

test_that("read_only flag still throws error when table is attempted to be created", {
Expand All @@ -74,4 +75,5 @@ test_that("read_only flag still throws error when table is attempted to be creat
con <- dbConnect(duckdb(), "tmp.duckdb", read_only=TRUE)
rel <- duckdb:::rel_from_df(con, mtcars)
expect_error(duckdb:::rel_sql(rel, "create table t2 as (SELECT cyl, disp FROM _ )"))
dbDisconnect(con)
})
Binary file added tests/testthat/tmp.duckdb
Binary file not shown.

0 comments on commit 3bb53c3

Please sign in to comment.