mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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
|
os.environ[k] = v
|
||||||
|
|
||||||
def test_getproxies_environment_keep_no_proxies(self):
|
def test_getproxies_environment_keep_no_proxies(self):
|
||||||
os.environ['NO_PROXY'] = 'localhost'
|
try:
|
||||||
proxies = urllib.request.getproxies_environment()
|
os.environ['NO_PROXY'] = 'localhost'
|
||||||
# getproxies_environment use lowered case truncated (no '_proxy') keys
|
proxies = urllib.request.getproxies_environment()
|
||||||
self.assertEquals('localhost', proxies['no'])
|
# 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):
|
class urlopen_HttpTests(unittest.TestCase):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue