mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
GH-139862: Fix direct instantiation of HelpFormatter (#142384)
This commit is contained in:
parent
f193c8fe9e
commit
dc9f2385ed
2 changed files with 7 additions and 0 deletions
|
|
@ -5694,6 +5694,11 @@ def custom_formatter(prog):
|
|||
a-very-long-command command that does something
|
||||
'''))
|
||||
|
||||
def test_direct_formatter_instantiation(self):
|
||||
formatter = argparse.HelpFormatter(prog="program")
|
||||
formatter.add_usage(usage=None, actions=[], groups=[])
|
||||
help_text = formatter.format_help()
|
||||
self.assertEqual(help_text, "usage: program\n")
|
||||
|
||||
# =====================================
|
||||
# Optional/Positional constructor tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue