``HelpFormatter.write_usage`` renders a single usage line whose trailing separator tracks whether ``args`` is non-empty.
(
formatter_kwargs, current_indent, prog, args, prefix, expected
)
| 560 | ], |
| 561 | ) |
| 562 | def test_help_formatter_write_usage( |
| 563 | formatter_kwargs, current_indent, prog, args, prefix, expected |
| 564 | ): |
| 565 | class="st">"""``HelpFormatter.write_usage`` renders a single usage line whose |
| 566 | trailing separator tracks whether ``args`` is non-empty. |
| 567 | class="st">""" |
| 568 | f = click.HelpFormatter(**formatter_kwargs) |
| 569 | f.current_indent = current_indent |
| 570 | if prefix is None: |
| 571 | f.write_usage(prog, args) |
| 572 | else: |
| 573 | f.write_usage(prog, args, prefix=prefix) |
| 574 | assert f.getvalue() == expected |
| 575 | |
| 576 | |
| 577 | def test_help_formatter_write_usage_without_args_styled_prefix(): |
nothing calls this directly
no test coverage detected