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 extra regression test for double backticks
  • Loading branch information
hugovk committed May 4, 2026
commit 634cfe62912df26140df2690888aa1edb1df19c4
2 changes: 2 additions & 0 deletions Lib/test/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -7705,12 +7705,14 @@ def test_backtick_markup_special_regex_chars(self):
def test_backtick_markup_in_argument_help(self):
Comment thread
savannahostrowski marked this conversation as resolved.
parser = argparse.ArgumentParser(prog="PROG", color=True)
parser.add_argument("--foo", help="set the `foo` value")
parser.add_argument("--bar", help="set the ``bar`` value")

prog_extra = self.theme.prog_extra
reset = self.theme.reset

help_text = parser.format_help()
self.assertIn(f"set the {prog_extra}foo{reset} value", help_text)
self.assertIn(f"set the {prog_extra}bar{reset} value", help_text)
self.assertNotIn("`", help_text)

def test_backtick_markup_in_argument_help_with_format(self):
Expand Down
Loading