From 365a98bf665e5e9f4be025f47a10d8b3b1451343 Mon Sep 17 00:00:00 2001 From: Samuel Fekete Date: Mon, 3 Jul 2017 15:16:23 +0100 Subject: [PATCH] Fix failing tests --- tests/integration/test_proxy.py | 2 +- vcr/stubs/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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(