Issue #28435: Merge urllib test fixes from 3.5 into 3.6

This commit is contained in:
Martin Panter 2016-10-22 03:21:36 +00:00
commit 85e81cfe9b
2 changed files with 10 additions and 0 deletions

View File

@ -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 = []

View File

@ -1473,6 +1473,7 @@ Al Sweigart
Thenault Sylvain
Péter Szabó
John Szakmeister
Piotr Szczepaniak
Amir Szekely
Maciej Szulik
Joel Taddei