vcrpy icon indicating copy to clipboard operation
vcrpy copied to clipboard

urllib compatibility

Open kevin1024 opened this issue 12 years ago • 6 comments

urllib (though deprecated) uses all kinds of weird httplib compat classes that aren't stubbed properly by vcr. I would like to support this someday.

kevin1024 avatar Sep 18 '13 08:09 kevin1024

I wonder if it would also solve the problem I encountered with newer version of google cloud sdk, where my tests fail with:

…
self = <fancy_urllib.PresetProxyHTTPSConnection object at 0x7fda42beb0d0>

    def connect(self):
>     httplib.HTTPConnection.connect(self)
E     TypeError: unbound method connect() must be called with VCRHTTPConnectionapplications/foundit/tests_unit/cassettes/successfull_payment_cus-gae.yaml instance as first argument (got PresetProxyHTTPSConnection instance instead)

/opt/google-cloud-sdk/platform/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py:190: TypeError

I'd like to help solving this problem, but some hints about where I should look and what should probably be done would be a great help.

matclab avatar Apr 15 '17 08:04 matclab

👋 Hi there! I'm a late comer to this issue 😄

@matclab, were you able to fix your Google App Engine + vcrpy issue? @kevin1024, is this still an open enhancement?

Thanks! I was pumped to find this library (big fan of the VCR flow), but I'm up against a similar urllib issue.

andrewsardone avatar Jan 12 '18 21:01 andrewsardone

@andrewsardone Unfortunately not. Using web2py I can do most of my unit test outside of GAE, and I've setup a continuous integration service to do the real online test (wityhout vcrpy) on GAE before shipping…

matclab avatar Jan 13 '18 13:01 matclab

Gotcha. Thanks for the reply, @matclab!

andrewsardone avatar Jan 14 '18 19:01 andrewsardone

@kevin1024 I'm also interested to use vcrpy for testing imdbpy. It uses urllib. Is it difficult to add support for this lib?

ramusus avatar Jan 28 '18 19:01 ramusus

A lot of changes have happened to VCRpy since this ticket was opened. As this ticket has become stale, would you mind closing it if it is no longer needed / relevant?

If I haven't heard anything in a week I'll mark it as closed as we have a lot of old tickets that need to be groomed to make it easier to see what is still relevant.

However if it is still needed, please feel free to re-open or create a new ticket.

Thanks! 🙏

neozenith avatar Jan 05 '20 22:01 neozenith