mirror of
https://github.com/python/cpython.git
synced 2024-12-02 14:24:12 +08:00
test_urllib would set environment variable NO_PROXY without removing it afterwards.
This commit is contained in:
parent
3de5a08420
commit
ff96b2ae14
@ -130,10 +130,14 @@ class ProxyTests(unittest.TestCase):
|
||||
os.environ[k] = v
|
||||
|
||||
def test_getproxies_environment_keep_no_proxies(self):
|
||||
os.environ['NO_PROXY'] = 'localhost'
|
||||
proxies = urllib.request.getproxies_environment()
|
||||
# getproxies_environment use lowered case truncated (no '_proxy') keys
|
||||
self.assertEquals('localhost', proxies['no'])
|
||||
try:
|
||||
os.environ['NO_PROXY'] = 'localhost'
|
||||
proxies = urllib.request.getproxies_environment()
|
||||
# getproxies_environment use lowered case truncated (no '_proxy') keys
|
||||
self.assertEquals('localhost', proxies['no'])
|
||||
finally:
|
||||
# The old value will be restored by tearDown, if applicable.
|
||||
del os.environ['NO_PROXY']
|
||||
|
||||
|
||||
class urlopen_HttpTests(unittest.TestCase):
|
||||
|
Loading…
Reference in New Issue
Block a user