Merged revisions 72167 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72167 | walter.doerwald | 2009-05-01 19:35:37 +0200 (Fr, 01 Mai 2009) | 5 lines
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.
........
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py
index e4ede4a..9c52f86 100644
--- a/Lib/test/test_optparse.py
+++ b/Lib/test/test_optparse.py
@@ -1449,7 +1449,7 @@
# screws things up for other tests when it's part of the Python
# test suite.
with support.EnvironmentVarGuard() as env:
- env.set('COLUMNS', str(columns))
+ env['COLUMNS'] = str(columns)
return InterceptingOptionParser(option_list=options)
def assertHelpEquals(self, expected_output):
@@ -1474,7 +1474,7 @@
def test_help_title_formatter(self):
with support.EnvironmentVarGuard() as env:
- env.set("COLUMNS", "80")
+ env["COLUMNS"] = "80"
self.parser.formatter = TitledHelpFormatter()
self.assertHelpEquals(_expected_help_title_formatter)