summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-10-22 03:21:36 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-10-22 03:21:36 (GMT)
commit85e81cfe9b51ff59a2065b5863d831ee7cb72b12 (patch)
treebbd2578f5a05a539250ff61d60dfe4c5045a66c3 /Lib/test
parent7e0062fca85237e785ce41a638f682495beb7540 (diff)
parent1002a621c1f0c8d5adcdd6462b9bdd0470e34290 (diff)
downloadcpython-85e81cfe9b51ff59a2065b5863d831ee7cb72b12.zip
cpython-85e81cfe9b51ff59a2065b5863d831ee7cb72b12.tar.gz
cpython-85e81cfe9b51ff59a2065b5863d831ee7cb72b12.tar.bz2
Issue #28435: Merge urllib test fixes from 3.5 into 3.6
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_urllib2_localnet.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
index e6a522c..70c4c01 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -323,6 +323,14 @@ class ProxyAuthTests(unittest.TestCase):
def setUp(self):
super(ProxyAuthTests, self).setUp()
+ # Ignore proxy bypass settings in the environment.
+ def restore_environ(old_environ):
+ os.environ.clear()
+ os.environ.update(old_environ)
+ self.addCleanup(restore_environ, os.environ.copy())
+ os.environ['NO_PROXY'] = ''
+ os.environ['no_proxy'] = ''
+
self.digest_auth_handler = DigestAuthHandler()
self.digest_auth_handler.set_users({self.USER: self.PASSWD})
self.digest_auth_handler.set_realm(self.REALM)
@@ -445,6 +453,7 @@ class TestUrlopen(unittest.TestCase):
os.environ.update(old_environ)
self.addCleanup(restore_environ, os.environ.copy())
os.environ['NO_PROXY'] = '*'
+ os.environ['no_proxy'] = '*'
def urlopen(self, url, data=None, **kwargs):
l = []