MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_text_group_in_parser

Function test_text_group_in_parser

tests/test_rich_utils.py:262–272  ·  view source on GitHub ↗

Print a TextGroup with argparse.

(capsys: pytest.CaptureFixture[str])

Source from the content-addressed store, hash-verified

260
261
262def test_text_group_in_parser(capsys: pytest.CaptureFixture[str]) -> None:
263 """Print a TextGroup with argparse."""
264 parser = Cmd2ArgumentParser(prog="test")
265 parser.epilog = ru.TextGroup("Notes", "Some text")
266
267 # Render help
268 parser.print_help()
269 out, _ = capsys.readouterr()
270
271 assert "Notes:" in out
272 assert " Some text" in out
273
274
275def test_formatter_init_mutually_exclusive() -> None:

Callers

nothing calls this directly

Calls 2

print_helpMethod · 0.95
Cmd2ArgumentParserClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…