def METHOD_NAME(capsys):
    with pytest.raises(SystemExit) as excinfo:
        cli.commitizen_excepthook(NotAGitProjectError, NotAGitProjectError(), "")
    assert excinfo.type == SystemExit
    assert excinfo.value.code == NotAGitProjectError.exit_code