Issue #28435: Merge urllib test fixes from 3.5 into 3.6
This commit is contained in:
commit
85e81cfe9b
|
@ -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 = []
|
||||
|
|
Loading…
Reference in New Issue