mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
test_urllib would set environment variable NO_PROXY without removing it afterwards.
This commit is contained in:
parent
3de5a08420
commit
ff96b2ae14
1 changed files with 8 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue