summaryrefslogtreecommitdiff
path: root/tests/test_requests.py
diff options
context:
space:
mode:
authorNate Prewitt <Nate.Prewitt@gmail.com>2018-09-30 18:36:05 -0600
committerNate Prewitt <Nate.Prewitt@gmail.com>2018-09-30 18:36:05 -0600
commitbbdbcc8f0553f112ff68b0950b4128bd8af000fc (patch)
tree8ca43c144afe896111ae3831672464423d341043 /tests/test_requests.py
parentff0c325014f817095de35013d385e137b111d6e8 (diff)
downloadpython-requests-bbdbcc8f0553f112ff68b0950b4128bd8af000fc.tar.gz
wrap url parsing exceptions from urllib3's PoolManager
Diffstat (limited to 'tests/test_requests.py')
-rw-r--r--tests/test_requests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_requests.py b/tests/test_requests.py
index 66043798..b4ee9f94 100644
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -2427,6 +2427,16 @@ class TestPreparingURLs(object):
r.prepare()
@pytest.mark.parametrize(
+ 'url, exception',
+ (
+ ('http://localhost:-1', InvalidURL),
+ )
+ )
+ def test_redirecting_to_bad_url(self, httpbin, url, exception):
+ with pytest.raises(exception):
+ r = requests.get(httpbin('redirect-to'), params={'url': url})
+
+ @pytest.mark.parametrize(
'input, expected',
(
(