(capsys)
| 537 | |
| 538 | |
| 539 | def 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 | ### |
nothing calls this directly
no test coverage detected
searching dependent graphs…