Make test.test_support.EnvironmentVarGuard behave like a dictionary.

All changes are mirrored to the underlying os.environ dict, but rolled back
on exit from the with block.
This commit is contained in:
Walter Dörwald 2009-05-01 17:35:37 +00:00
parent ca87fa5a5b
commit 6733bed57e
11 changed files with 72 additions and 67 deletions

View file

@ -103,7 +103,7 @@ class ProxyTests(unittest.TestCase):
# Delete all proxy related env vars
for k, v in os.environ.iteritems():
if 'proxy' in k.lower():
env.unset(k)
del env[k]
def tearDown(self):
# Restore all proxy related env vars