diff options
| author | Walter Dörwald <walter@livinglogic.de> | 2009-05-01 17:35:37 (GMT) |
|---|---|---|
| committer | Walter Dörwald <walter@livinglogic.de> | 2009-05-01 17:35:37 (GMT) |
| commit | 6733bed57e780008f8c78422d2a9676b9a2710cf (patch) | |
| tree | 9ac7e1469b55cba61664a2b07e50566320a814d9 /Lib/test/test_optparse.py | |
| parent | ca87fa5a5b650de2d4b5cb04fb5847cf631e75eb (diff) | |
| download | cpython-6733bed57e780008f8c78422d2a9676b9a2710cf.zip cpython-6733bed57e780008f8c78422d2a9676b9a2710cf.tar.gz cpython-6733bed57e780008f8c78422d2a9676b9a2710cf.tar.bz2 | |
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.
Diffstat (limited to 'Lib/test/test_optparse.py')
| -rw-r--r-- | Lib/test/test_optparse.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py index f27864a..7483fe7 100644 --- a/Lib/test/test_optparse.py +++ b/Lib/test/test_optparse.py @@ -1465,7 +1465,7 @@ class TestHelp(BaseTest): # screws things up for other tests when it's part of the Python # test suite. with test_support.EnvironmentVarGuard() as env: - env.set('COLUMNS', str(columns)) + env['COLUMNS'] = str(columns) return InterceptingOptionParser(option_list=options) def assertHelpEquals(self, expected_output): @@ -1494,7 +1494,7 @@ class TestHelp(BaseTest): def test_help_title_formatter(self): with test_support.EnvironmentVarGuard() as env: - env.set("COLUMNS", "80") + env["COLUMNS"] = "80" self.parser.formatter = TitledHelpFormatter() self.assertHelpEquals(_expected_help_title_formatter) |
