diff --git a/tests/integration/test_proxy.py b/tests/integration/test_proxy.py index 3212b24..ce67e60 100644 --- a/tests/integration/test_proxy.py +++ b/tests/integration/test_proxy.py @@ -37,6 +37,6 @@ def proxy_server(httpbin): def test_use_proxy(tmpdir, httpbin, proxy_server): '''Ensure that it works with a proxy.''' - with vcr.use_cassette(str(tmpdir.join('proxy.yaml'))) as cass: + with vcr.use_cassette(str(tmpdir.join('proxy.yaml'))): requests.get(httpbin.url, proxies={'http': proxy_server}) requests.get(httpbin.url, proxies={'http': proxy_server}) diff --git a/vcr/stubs/__init__.py b/vcr/stubs/__init__.py index 6ebe2e8..763204e 100644 --- a/vcr/stubs/__init__.py +++ b/vcr/stubs/__init__.py @@ -136,7 +136,7 @@ class VCRConnection(object): def _uri(self, url): """Returns request absolute URI""" - if not url.startswith('/'): + if url and not url.startswith('/'): # Then this must be a proxy request. return url uri = "{0}://{1}{2}{3}".format(