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

Function test_apcustom_print_message

tests/test_argparse_utils.py:247–260  ·  view source on GitHub ↗
(capsys)

Source from the content-addressed store, hash-verified

245
246
247def test_apcustom_print_message(capsys) -> None:
248 test_message = "The test message"
249
250 # Specify the file
251 parser = Cmd2ArgumentParser()
252 parser._print_message(test_message, file=sys.stdout)
253 out, err = capsys.readouterr()
254 assert test_message in out
255
256 # Make sure file defaults to sys.stderr
257 parser = Cmd2ArgumentParser()
258 parser._print_message(test_message)
259 out, err = capsys.readouterr()
260 assert test_message in err
261
262
263def test_build_range_error() -> None:

Callers

nothing calls this directly

Calls 1

Cmd2ArgumentParserClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…