Print a TextGroup with argparse.
(capsys: pytest.CaptureFixture[str])
| 260 | |
| 261 | |
| 262 | def 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 | |
| 275 | def test_formatter_init_mutually_exclusive() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…