summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-12-26 09:45:22 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-12-26 09:45:22 (GMT)
commit2f01e239cb67d7d72d08e2b6f1a7c7769ee41b25 (patch)
tree7b5becff5aec2a425c70bce71c4f8303a619dfd6
parentcf4710c3234f77d68e57bf8fe2d9ca4e96a8b085 (diff)
downloadcpython-2f01e239cb67d7d72d08e2b6f1a7c7769ee41b25.zip
cpython-2f01e239cb67d7d72d08e2b6f1a7c7769ee41b25.tar.gz
cpython-2f01e239cb67d7d72d08e2b6f1a7c7769ee41b25.tar.bz2
Issue #16702: Skip proxies for localhost in urllib2_localnet tests
-rw-r--r--Lib/test/test_urllib2_localnet.py8
-rw-r--r--Misc/NEWS3
2 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
index 0fda770..ec34375 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -5,7 +5,9 @@ import urllib2
import BaseHTTPServer
import unittest
import hashlib
+
from test import test_support
+
mimetools = test_support.import_module('mimetools', deprecated=True)
threading = test_support.import_module('threading')
@@ -346,6 +348,12 @@ class TestUrlopen(BaseTestCase):
for transparent redirection have been written.
"""
+ def setUp(self):
+ proxy_handler = urllib2.ProxyHandler({})
+ opener = urllib2.build_opener(proxy_handler)
+ urllib2.install_opener(opener)
+ super(TestUrlopen, self).setUp()
+
def start_server(self, responses):
handler = GetRequestHandler(responses)
diff --git a/Misc/NEWS b/Misc/NEWS
index 58a6374..381b091 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -164,6 +164,9 @@ Core and Builtins
Library
-------
+- Issue #16702: test_urllib2_localnet tests now correctly ignores proxies for
+ localhost tests.
+
- Issue #16713: Fix the parsing of tel url with params using urlparse module.
- Issue #16443: Add docstrings to regular expression match objects.