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

dbConnect() method fails when testing manually under DBItest #5

Closed
sz-cgt opened this issue May 27, 2018 · 1 comment
Closed

dbConnect() method fails when testing manually under DBItest #5

sz-cgt opened this issue May 27, 2018 · 1 comment

Comments

@sz-cgt
Copy link

sz-cgt commented May 27, 2018

While running the test harness under RStudio works ok, doing this

> devtools::load_all(".")
> source('~/Projects/RKazam/tests/testthat/test-DBItest.R', echo=TRUE)

produces this

Error: Test failed: 'DBItest[RKazam]: Driver: can_connect'
* could not find function "skip"
1: expect_warning(con <- expect_visible(connect(ctx)), NA)
2: quasi_capture(enquo(object), capture_warnings, label = label)
3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
4: withCallingHandlers(code, warning = function(condition) {
       out$push(condition)
       invokeRestart("muffleWarning")
   })
5: eval_bare(get_expr(quo), get_env(quo))
6: expect_visible(connect(ctx))
7: withVisible(code)
8: connect(ctx)
9: connect_fun()
10: dbConnect(new("KazamDriver", ))
11: dbConnect(new("KazamDriver", ))

The fix is simple. The call to skip() on line #45 should be to testthat::skip()

diff --git a/R/Driver.R b/R/Driver.R
index 49b7625..2bb9bac 100644
--- a/R/Driver.R
+++ b/R/Driver.R
@@ -42,7 +42,7 @@ setMethod(
 setMethod(
   "dbConnect", "KazamDriver",
   function(drv, ...) {
-    skip("Not connecting")
+    testthat::skip("Not connecting")
     # TODO: Remove skip() call
     KazamConnection()
   }

It's a small issue but if, like me, you're trying to understand the framework before coding a new driver, it's nice to have everything run cleanly.

@krlmlr krlmlr closed this as completed in 0eacc31 May 27, 2018
@krlmlr
Copy link
Member

krlmlr commented May 27, 2018

Thanks for filing the issue.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants