def test_run_pre_prompt_python_hook_fail(monkeypatch) -> None:
    """Verify pre_prompt.py will fail when a given env var is present."""
    message = 'Pre-Prompt Hook script failed'
    with monkeypatch.context() as m:
        m.setenv('COOKIECUTTER_FAIL_PRE_PROMPT', '1')
        with pytest.raises(FailedHookException) as excinfo:
            hooks.run_pre_prompt_hook(repo_dir='tests/test-pyhooks/')
    assert message in str(excinfo.value)
Verify pre_prompt.py will fail when a given env var is present.
tests/test_pre_prompt_hooks.py