def test_debug_list_installed_templates_failure(
    cli_runner, debug_file, user_config_path
) -> None:
    """Verify --list-installed command error on invocation."""
    os.makedirs(os.path.dirname(user_config_path))
    Path(user_config_path).write_text('cookiecutters_dir: "/notarealplace/"')

    result = cli_runner(
        '--list-installed', '--config-file', user_config_path, str(debug_file)
    )

    assert "Error: Cannot list installed templates." in result.output
    assert result.exit_code == -1
Verify --list-installed command error on invocation.
tests/test_cli.py