Remove a dependency of this test on $COLUMNS.
This commit is contained in:
parent
0741a60ca7
commit
0567ba20f3
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue