snowflake-vcrpy icon indicating copy to clipboard operation
snowflake-vcrpy copied to clipboard

Request: a more compatible, robust approach

Open patrickmckenna opened this issue 1 year ago • 1 comments

Thanks for starting this. It's a welcome effort towards making writing tests against snowflake-connector-pythons APIs more feasible.

However, for those of us already using VCR.py, or anyone who'd want to, the current implementation creates as many problems as it solves. The underlying issue, AFAICT, is the choice to vendor VCR.py, instead of simply declaring it as a dependency. Anyone already using VCR.py will now get a second version of it, which introduces needless complexity, and has, in my experience so far, made it very tricky to actually use without breaking things. Hard-coding some config values, and exposing a different configuration API than VCR.py does, or plugins like pytest-recording do, only complicates matters.

Perhaps there's context I'm missing, but as best as I can tell, the root issue is that snowflake-connector-python takes the same approach with respect to requests and urllib3, vendoring them. VCR.py knows how to patch plain urllib3, and the versions that come packaged with botocore and requests, but doesn't know about this new variant. A robust fix for this—and robustness is certainly desirable when it comes to testing tools—would involve extending VCR.py using its public APIs, or opening a PR against it, if those APIs are too limited. (I'm assuming that, for reasons, snowflake-connector-python won't switch to using a standard version of requests or urllib3 anytime soon.)

Again, this is a welcome effort, but its real world utility will greatly limited if it doesn't integrate well with the popular tools on which its based.

patrickmckenna avatar Apr 13 '23 01:04 patrickmckenna