Remove a dependency of this test on $COLUMNS.

This commit is contained in:
Guido van Rossum 2007-01-14 03:46:33 +00:00
parent 0741a60ca7
commit 0567ba20f3
1 changed files with 10 additions and 2 deletions

View File

@ -1500,8 +1500,16 @@ class TestHelp(BaseTest):
self.assertHelpEquals(_expected_help_long_opts_first)
def test_help_title_formatter(self):
self.parser.formatter = TitledHelpFormatter()
self.assertHelpEquals(_expected_help_title_formatter)
save = os.environ.get("COLUMNS")
try:
os.environ["COLUMNS"] = "80"
self.parser.formatter = TitledHelpFormatter()
self.assertHelpEquals(_expected_help_title_formatter)
finally:
if save is not None:
os.environ["COLUMNS"] = save
else:
del os.environ["COLUMNS"]
def test_wrap_columns(self):
# Ensure that wrapping respects $COLUMNS environment variable.