Commit 0ee09691 authored by Antoine Pitrou's avatar Antoine Pitrou

test_urllib would set environment variable NO_PROXY without removing it afterwards.

parent 45c1f289
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment