Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add regression test for direct instantiation of HelpFormatter
  • Loading branch information
savannahostrowski committed Dec 7, 2025
commit c04ba18cb2acbd3321553d61bf02cdb71d4e1821
5 changes: 5 additions & 0 deletions Lib/test/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading