def test_debug_file_verbose(cli_runner, debug_file) -> None:
    """Test cli invocation writes log to `debug-file` if flag enabled.

    Case for verbose log output.
    """
    assert not debug_file.exists()

    result = cli_runner(
        '--verbose',
        '--no-input',
        '--debug-file',
        str(debug_file),
        'tests/fake-repo-pre/',
    )
    assert result.exit_code == 0

    assert debug_file.exists()

    context_log = (
        "DEBUG cookiecutter.main: context_file is "
        "tests/fake-repo-pre/cookiecutter.json"
    )
    assert context_log in debug_file.read_text()
    assert context_log in result.output
Test cli invocation writes log to `debug-file` if flag enabled.

    Case for verbose log output.
    
tests/test_cli.py