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})
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(