Skip to content

Conversation

@MichaelChirico
Copy link
Contributor

Currently this can fail like:

hasMethod("dbDisconnect", "MyDBIConnection", driver_package) is not TRUE

`actual`:   FALSE
`expected`: TRUE 
Backtrace:
     x
  1. \-DBItest:::spec_compliance$compliance(ctx = ctx)
  2.   \-base::sapply(...) at [rbuild/R/spec-compliance-methods.R:30]
  3.     \-base::lapply(X = X, FUN = FUN, ...)
  4.       \-DBItest (local) FUN(X[[i]], ...)
  5.         \-base::mapply(...) at [rbuild/R/spec-compliance-methods.R:44]
  6.           \-DBItest (local) `<fn>`(dots[[1L]][[1L]], dots[[2L]][[1L]])
  7.             \-DBItest:::expect_has_class_method(method, class, args, where) at [rbuild/R/spec-compliance-methods.R:45]
  8.               +-base::eval(...) at [rbuild/R/spec-compliance-methods.R:100]
  9.               | \-base::eval(...)
 10.               \-testthat::expect_true(...)

I'm unsure why this is failing, but seeing driver_package makes it a bit harder -- with this change the error should look like this instead:

hasMethod("dbDisconnect", signature = "MyDBIConnection", asNamespace("<searched package>")) is not TRUE

That will give something more actionable for my debugging.

@krlmlr krlmlr changed the title Suggestion to improve failure mode of missing method test feat: Improve failure mode of missing method test May 2, 2025
@krlmlr krlmlr merged commit f83270a into r-dbi:main May 2, 2025
16 checks passed
@krlmlr
Copy link
Member

krlmlr commented May 2, 2025

Thanks. I'm fine if it helps you, didn't look too closely. Let's see what happens with the other backends.

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.

2 participants