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

Function test_postparsing_hook_exception

tests/test_plugin.py:539–557  ·  view source on GitHub ↗
(capsys)

Source from the content-addressed store, hash-verified

537
538
539def test_postparsing_hook_exception(capsys) -> None:
540 app = PluggedApp()
541 app.register_postparsing_hook(app.postparse_hook_exception)
542 stop = app.onecmd_plus_hooks("say hello")
543 out, err = capsys.readouterr()
544 assert not stop
545 assert not out
546 assert err
547 assert app.called_postparsing == 1
548
549 # register another function, but it shouldn't be called
550 app.reset_counters()
551 app.register_postparsing_hook(app.postparse_hook)
552 stop = app.onecmd_plus_hooks("say hello")
553 out, err = capsys.readouterr()
554 assert not stop
555 assert not out
556 assert err
557 assert app.called_postparsing == 1
558
559
560###

Callers

nothing calls this directly

Calls 4

PluggedAppClass · 0.85
onecmd_plus_hooksMethod · 0.80
reset_countersMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…