(capsys)
| 955 | |
| 956 | |
| 957 | def test_skip_postcmd_hooks(capsys) -> None: |
| 958 | app = PluggedApp() |
| 959 | app.register_postcmd_hook(app.postcmd_hook) |
| 960 | app.register_cmdfinalization_hook(app.cmdfinalization_hook) |
| 961 | |
| 962 | # Cause a SkipPostcommandHooks exception and verify no postcmd stuff runs but cmdfinalization_hook still does |
| 963 | app.onecmd_plus_hooks("skip_postcmd_hooks") |
| 964 | out, _err = capsys.readouterr() |
| 965 | assert "In do_skip_postcmd_hooks" in out |
| 966 | assert app.called_postcmd == 0 |
| 967 | assert app.called_cmdfinalization == 1 |
| 968 | |
| 969 | |
| 970 | def test_cmd2_argparse_exception(capsys) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…