test that `python -m PKG [subcommand] -h` works
(pkg: str, subcommand: Sequence[str] | None = None)
| 16 | |
| 17 | |
| 18 | def check_help_output(pkg: str, subcommand: Sequence[str] | None = None) -> tuple[str, str]: |
| 19 | """test that `python -m PKG [subcommand] -h` works""" |
| 20 | cmd = [sys.executable, "-m", pkg] |
| 21 | if subcommand: |
| 22 | cmd.extend(subcommand) |
| 23 | cmd.append("-h") |
| 24 | out, err, rc = get_output_error_code(cmd) |
| 25 | assert rc == 0, err |
| 26 | assert "Traceback" not in err |
| 27 | assert "Options" in out |
| 28 | assert "--help-all" in out |
| 29 | return out, err |
| 30 | |
| 31 | |
| 32 | def check_help_all_output(pkg: str, subcommand: Sequence[str] | None = None) -> tuple[str, str]: |
searching dependent graphs…