MCPcopy Create free account
hub / github.com/ipython/traitlets / check_help_output

Function check_help_output

traitlets/tests/utils.py:18–29  ·  view source on GitHub ↗

test that `python -m PKG [subcommand] -h` works

(pkg: str, subcommand: Sequence[str] | None = None)

Source from the content-addressed store, hash-verified

16
17
18def 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
32def check_help_all_output(pkg: str, subcommand: Sequence[str] | None = None) -> tuple[str, str]:

Callers 1

test_help_outputFunction · 0.90

Calls 3

get_output_error_codeFunction · 0.85
extendMethod · 0.80
appendMethod · 0.80

Tested by 1

test_help_outputFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…