============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-9.0.2, pluggy-1.6.0 -- /usr/bin/python
cachedir: .pytest_cache
metadata: {'Python': '3.10.12', 'Platform': 'Linux-6.8.0-1025-gke-x86_64-with-glibc2.35', 'Packages': {'pytest': '9.0.2', 'pluggy': '1.6.0'}, 'Plugins': {'anyio': '4.12.1', 'mock': '3.15.1', 'metadata': '3.1.1', 'json-report': '1.5.0', 'cov': '7.0.0'}}
rootdir: /workspace/cookiecutter
configfile: setup.cfg
plugins: anyio-4.12.1, mock-3.15.1, metadata-3.1.1, json-report-1.5.0, cov-7.0.0
collecting ... collected 371 items

tests/replay/test_dump.py::test_type_error_if_no_template_name PASSED    [  0%]
tests/replay/test_dump.py::test_type_error_if_not_dict_context PASSED    [  0%]
tests/replay/test_dump.py::test_value_error_if_key_missing_in_context PASSED [  0%]
tests/replay/test_dump.py::test_ioerror_if_replay_dir_creation_fails PASSED [  1%]
tests/replay/test_dump.py::test_run_json_dump PASSED                     [  1%]
tests/replay/test_load.py::test_type_error_if_no_template_name PASSED    [  1%]
tests/replay/test_load.py::test_value_error_if_key_missing_in_context PASSED [  1%]
tests/replay/test_load.py::test_io_error_if_no_replay_file PASSED        [  2%]
tests/replay/test_load.py::test_run_json_load PASSED                     [  2%]
tests/replay/test_replay.py::test_get_replay_file_name[bar] PASSED       [  2%]
tests/replay/test_replay.py::test_get_replay_file_name[bar.json] PASSED  [  2%]
tests/replay/test_replay.py::test_raise_on_invalid_mode[invalid_kwargs0] PASSED [  3%]
tests/replay/test_replay.py::test_raise_on_invalid_mode[invalid_kwargs1] PASSED [  3%]
tests/replay/test_replay.py::test_raise_on_invalid_mode[invalid_kwargs2] PASSED [  3%]
tests/replay/test_replay.py::test_main_does_not_invoke_dump_but_load PASSED [  4%]
tests/replay/test_replay.py::test_main_does_not_invoke_load_but_dump PASSED [  4%]
tests/repository/test_abbreviation_expansion.py::test_abbreviation_expansion[Simple expansion] PASSED [  4%]
tests/repository/test_abbreviation_expansion.py::test_abbreviation_expansion[Skip expansion (expansion not an abbreviation)] PASSED [  4%]
tests/repository/test_abbreviation_expansion.py::test_abbreviation_expansion[Expansion prefix] PASSED [  5%]
tests/repository/test_abbreviation_expansion.py::test_abbreviation_expansion[expansion_override_builtin] PASSED [  5%]
tests/repository/test_abbreviation_expansion.py::test_abbreviation_expansion[expansion_prefix_ignores_suffix] PASSED [  5%]
tests/repository/test_abbreviation_expansion.py::test_abbreviation_expansion[Correct expansion for builtin abbreviations (github)] PASSED [  5%]
tests/repository/test_abbreviation_expansion.py::test_abbreviation_expansion[Correct expansion for builtin abbreviations (gitlab)] PASSED [  6%]
tests/repository/test_abbreviation_expansion.py::test_abbreviation_expansion[Correct expansion for builtin abbreviations (bitbucket)] PASSED [  6%]
tests/repository/test_abbreviation_expansion.py::test_abbreviation_expansion_prefix_not_0_in_braces PASSED [  6%]
tests/repository/test_determine_repo_dir_clones_repo.py::test_zipfile_unzip[/path/to/zipfile.zip-False] PASSED [  7%]
tests/repository/test_determine_repo_dir_clones_repo.py::test_zipfile_unzip[https://example.com/path/to/zipfile.zip-True] PASSED [  7%]
tests/repository/test_determine_repo_dir_clones_repo.py::test_zipfile_unzip[http://example.com/path/to/zipfile.zip-True] PASSED [  7%]
tests/repository/test_determine_repo_dir_clones_repo.py::test_repository_url_should_clone PASSED [  7%]
tests/repository/test_determine_repo_dir_clones_repo.py::test_repository_url_with_no_context_file PASSED [  8%]
tests/repository/test_determine_repo_dir_finds_existing_cookiecutter.py::test_should_find_existing_cookiecutter PASSED [  8%]
tests/repository/test_determine_repo_dir_finds_subdirectories.py::test_should_find_existing_cookiecutter FAILED [  8%]
tests/repository/test_determine_repo_dir_finds_subdirectories.py::test_local_repo_typo FAILED [  8%]
tests/repository/test_determine_repository_should_use_local_repo.py::test_finds_local_repo FAILED [  9%]
tests/repository/test_determine_repository_should_use_local_repo.py::test_local_repo_with_no_context_raises FAILED [  9%]
tests/repository/test_determine_repository_should_use_local_repo.py::test_local_repo_typo FAILED [  9%]
tests/repository/test_is_repo_url.py::test_is_zip_file[/path/to/zipfile.zip] PASSED [  9%]
tests/repository/test_is_repo_url.py::test_is_zip_file[https://example.com/path/to/zipfile.zip] PASSED [ 10%]
tests/repository/test_is_repo_url.py::test_is_zip_file[http://example.com/path/to/zipfile.zip] PASSED [ 10%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_remote_urls[gitolite@server:team/repo] PASSED [ 10%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_remote_urls[git@github.com:audreyfeldroy/cookiecutter.git] PASSED [ 11%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_remote_urls[https://github.com/cookiecutter/cookiecutter.git] PASSED [ 11%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_remote_urls[git+https://private.com/gitrepo] PASSED [ 11%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_remote_urls[hg+https://private.com/mercurialrepo] PASSED [ 11%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_remote_urls[https://bitbucket.org/pokoli/cookiecutter.hg] PASSED [ 12%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_remote_urls[file://server/path/to/repo.git] PASSED [ 12%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_local_urls[/audreyr/cookiecutter.git] PASSED [ 12%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_local_urls[/home/audreyr/cookiecutter] PASSED [ 12%]
tests/repository/test_is_repo_url.py::test_is_repo_url_for_local_urls[c:\\users\\foo\\appdata\\local\\temp\\1\\pytest-0\\test_default_output_dir0\\template] PASSED [ 13%]
tests/repository/test_is_repo_url.py::test_expand_abbreviations PASSED   [ 13%]
tests/repository/test_repository_has_cookiecutter_json.py::test_valid_repository PASSED [ 13%]
tests/repository/test_repository_has_cookiecutter_json.py::test_invalid_repository[tests/fake-repo-bad] PASSED [ 14%]
tests/repository/test_repository_has_cookiecutter_json.py::test_invalid_repository[tests/unknown-repo] PASSED [ 14%]
tests/test_abort_generate_on_hook_error.py::test_hooks_raises_errors[pre_gen_hook_raises_error] PASSED [ 14%]
tests/test_abort_generate_on_hook_error.py::test_hooks_raises_errors[post_gen_hook_raises_error] PASSED [ 14%]
tests/test_cli.py::test_cli_version[-V] FAILED                           [ 15%]
tests/test_cli.py::test_cli_version[--version] FAILED                    [ 15%]
tests/test_cli.py::test_cli_error_on_existing_output_directory FAILED    [ 15%]
tests/test_cli.py::test_cli FAILED                                       [ 15%]
tests/test_cli.py::test_cli_verbose FAILED                               [ 16%]
tests/test_cli.py::test_cli_replay FAILED                                [ 16%]
tests/test_cli.py::test_cli_replay_file FAILED                           [ 16%]
tests/test_cli.py::test_cli_replay_generated FAILED                      [ 16%]
tests/test_cli.py::test_cli_exit_on_noinput_and_replay FAILED            [ 17%]
tests/test_cli.py::test_run_cookiecutter_on_overwrite_if_exists_and_replay[-f] FAILED [ 17%]
tests/test_cli.py::test_run_cookiecutter_on_overwrite_if_exists_and_replay[--overwrite-if-exists] FAILED [ 17%]
tests/test_cli.py::test_cli_overwrite_if_exists_when_output_dir_does_not_exist[-f] FAILED [ 18%]
tests/test_cli.py::test_cli_overwrite_if_exists_when_output_dir_does_not_exist[--overwrite-if-exists] FAILED [ 18%]
tests/test_cli.py::test_cli_overwrite_if_exists_when_output_dir_exists[-f] PASSED [ 18%]
tests/test_cli.py::test_cli_overwrite_if_exists_when_output_dir_exists[--overwrite-if-exists] PASSED [ 18%]
tests/test_cli.py::test_cli_output_dir[-o] FAILED                        [ 19%]
tests/test_cli.py::test_cli_output_dir[--output-dir] FAILED              [ 19%]
tests/test_cli.py::test_cli_help[-h] PASSED                              [ 19%]
tests/test_cli.py::test_cli_help[--help] PASSED                          [ 19%]
tests/test_cli.py::test_cli_help[help] FAILED                            [ 20%]
tests/test_cli.py::test_user_config FAILED                               [ 20%]
tests/test_cli.py::test_default_user_config_overwrite FAILED             [ 20%]
tests/test_cli.py::test_default_user_config FAILED                       [ 21%]
tests/test_cli.py::test_echo_undefined_variable_error FAILED             [ 21%]
tests/test_cli.py::test_echo_unknown_extension_error FAILED              [ 21%]
tests/test_cli.py::test_local_extension FAILED                           [ 21%]
tests/test_cli.py::test_local_extension_not_available PASSED             [ 22%]
tests/test_cli.py::test_cli_extra_context FAILED                         [ 22%]
tests/test_cli.py::test_cli_extra_context_invalid_format FAILED          [ 22%]
tests/test_cli.py::test_debug_file_non_verbose FAILED                    [ 22%]
tests/test_cli.py::test_debug_file_verbose FAILED                        [ 23%]
tests/test_cli.py::test_debug_list_installed_templates FAILED            [ 23%]
tests/test_cli.py::test_debug_list_installed_templates_failure FAILED    [ 23%]
tests/test_cli.py::test_directory_repo FAILED                            [ 23%]
tests/test_cli.py::test_cli_accept_hooks[-o---accept-hooks=yes-None-True] FAILED [ 24%]
tests/test_cli.py::test_cli_accept_hooks[-o---accept-hooks=no-None-False] FAILED [ 24%]
tests/test_cli.py::test_cli_accept_hooks[-o---accept-hooks=ask-yes-True] FAILED [ 24%]
tests/test_cli.py::test_cli_accept_hooks[-o---accept-hooks=ask-no-False] FAILED [ 25%]
tests/test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=yes-None-True] FAILED [ 25%]
tests/test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=no-None-False] FAILED [ 25%]
tests/test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=ask-yes-True] FAILED [ 25%]
tests/test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=ask-no-False] FAILED [ 26%]
tests/test_cli.py::test_cli_with_json_decoding_error FAILED              [ 26%]
tests/test_cli.py::test_cli_with_pre_prompt_hook FAILED                  [ 26%]
tests/test_cli.py::test_cli_with_pre_prompt_hook_fail FAILED             [ 26%]
tests/test_cookiecutter_invocation.py::test_should_invoke_main FAILED    [ 27%]
tests/test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_return_project_dir[tests/fake-repo-pre/] FAILED [ 27%]
tests/test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_return_project_dir[tests/fake-repo-pre] FAILED [ 27%]
tests/test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_extra_context PASSED [ 28%]
tests/test_cookiecutter_local_no_input.py::test_cookiecutter_templated_context FAILED [ 28%]
tests/test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_return_rendered_file FAILED [ 28%]
tests/test_cookiecutter_local_no_input.py::test_cookiecutter_dict_values_in_context FAILED [ 28%]
tests/test_cookiecutter_local_no_input.py::test_cookiecutter_template_cleanup FAILED [ 29%]
tests/test_cookiecutter_local_with_input.py::test_cookiecutter_local_with_input FAILED [ 29%]
tests/test_cookiecutter_local_with_input.py::test_cookiecutter_input_extra_context FAILED [ 29%]
tests/test_cookiecutter_nested_templates.py::test_cookiecutter_nested_templates[fake-nested-templates-fake-project] FAILED [ 29%]
tests/test_cookiecutter_nested_templates.py::test_cookiecutter_nested_templates[fake-nested-templates-old-style-fake-package] FAILED [ 30%]
tests/test_custom_extensions_in_hooks.py::test_hook_with_extension[pre_gen_hook] FAILED [ 30%]
tests/test_custom_extensions_in_hooks.py::test_hook_with_extension[post_gen_hook] FAILED [ 30%]
tests/test_default_extensions.py::test_jinja2_time_extension FAILED      [ 30%]
tests/test_default_extensions.py::test_jinja2_slugify_extension FAILED   [ 31%]
tests/test_default_extensions.py::test_jinja2_uuid_extension FAILED      [ 31%]
tests/test_environment.py::test_env_should_raise_for_unknown_extension PASSED [ 31%]
tests/test_environment.py::test_env_should_come_with_default_extensions PASSED [ 32%]
tests/test_exceptions.py::test_undefined_variable_to_str PASSED          [ 32%]
tests/test_find.py::test_find_template[template with default jinja strings] PASSED [ 32%]
tests/test_find.py::test_find_template[template with custom jinja strings] PASSED [ 32%]
tests/test_find.py::test_find_template[template with custom jinja strings but folder with default jinja strings] PASSED [ 33%]
tests/test_find.py::test_find_template[template missing folder] PASSED   [ 33%]
tests/test_generate_context.py::test_generate_context[input_params0-expected_context0] PASSED [ 33%]
tests/test_generate_context.py::test_generate_context[input_params1-expected_context1] PASSED [ 33%]
tests/test_generate_context.py::test_generate_context[input_params2-expected_context2] PASSED [ 34%]
tests/test_generate_context.py::test_generate_context[input_params3-expected_context3] PASSED [ 34%]
tests/test_generate_context.py::test_generate_context_with_json_decoding_error PASSED [ 34%]
tests/test_generate_context.py::test_default_context_replacement_in_generate_context PASSED [ 35%]
tests/test_generate_context.py::test_generate_context_decodes_non_ascii_chars PASSED [ 35%]
tests/test_generate_context.py::test_apply_overwrites_does_include_unused_variables PASSED [ 35%]
tests/test_generate_context.py::test_apply_overwrites_sets_non_list_value PASSED [ 35%]
tests/test_generate_context.py::test_apply_overwrites_does_not_modify_choices_for_invalid_overwrite PASSED [ 36%]
tests/test_generate_context.py::test_apply_overwrites_invalid_overwrite PASSED [ 36%]
tests/test_generate_context.py::test_apply_overwrites_sets_multichoice_values PASSED [ 36%]
tests/test_generate_context.py::test_apply_overwrites_invalid_multichoice_values PASSED [ 36%]
tests/test_generate_context.py::test_apply_overwrites_error_additional_values PASSED [ 37%]
tests/test_generate_context.py::test_apply_overwrites_in_dictionaries PASSED [ 37%]
tests/test_generate_context.py::test_apply_overwrites_sets_default_for_choice_variable PASSED [ 37%]
tests/test_generate_context.py::test_apply_overwrites_in_nested_dict PASSED [ 38%]
tests/test_generate_context.py::test_apply_overwrite_context_as_in_nested_dict_with_additional_values PASSED [ 38%]
tests/test_generate_context.py::test_apply_overwrites_in_nested_dict_additional_values PASSED [ 38%]
tests/test_generate_copy_without_render.py::test_generate_copy_without_render_extensions FAILED [ 38%]
tests/test_generate_copy_without_render_override.py::test_generate_copy_without_render_extensions FAILED [ 39%]
tests/test_generate_file.py::test_generate_file PASSED                   [ 39%]
tests/test_generate_file.py::test_generate_file_jsonify_filter PASSED    [ 39%]
tests/test_generate_file.py::test_generate_file_random_ascii_string[True-10] PASSED [ 39%]
tests/test_generate_file.py::test_generate_file_random_ascii_string[True-40] PASSED [ 40%]
tests/test_generate_file.py::test_generate_file_random_ascii_string[False-10] PASSED [ 40%]
tests/test_generate_file.py::test_generate_file_random_ascii_string[False-40] PASSED [ 40%]
tests/test_generate_file.py::test_generate_file_with_true_condition PASSED [ 40%]
tests/test_generate_file.py::test_generate_file_with_false_condition FAILED [ 41%]
tests/test_generate_file.py::test_generate_file_verbose_template_syntax_error FAILED [ 41%]
tests/test_generate_file.py::test_generate_file_does_not_translate_lf_newlines_to_crlf PASSED [ 41%]
tests/test_generate_file.py::test_generate_file_does_not_translate_crlf_newlines_to_lf FAILED [ 42%]
tests/test_generate_file.py::test_generate_file_handles_mixed_line_endings PASSED [ 42%]
tests/test_generate_files.py::test_generate_files_nontemplated_exception PASSED [ 42%]
tests/test_generate_files.py::test_generate_files FAILED                 [ 42%]
tests/test_generate_files.py::test_generate_files_with_linux_newline PASSED [ 43%]
tests/test_generate_files.py::test_generate_files_with_jinja2_environment PASSED [ 43%]
tests/test_generate_files.py::test_generate_files_with_trailing_newline_forced_to_linux_by_context FAILED [ 43%]
tests/test_generate_files.py::test_generate_files_with_windows_newline FAILED [ 43%]
tests/test_generate_files.py::test_generate_files_with_windows_newline_forced_to_linux_by_context PASSED [ 44%]
tests/test_generate_files.py::test_generate_files_binaries FAILED        [ 44%]
tests/test_generate_files.py::test_generate_files_absolute_path PASSED   [ 44%]
tests/test_generate_files.py::test_generate_files_output_dir PASSED      [ 45%]
tests/test_generate_files.py::test_generate_files_permissions FAILED     [ 45%]
tests/test_generate_files.py::test_generate_files_with_overwrite_if_exists_with_skip_if_file_exists FAILED [ 45%]
tests/test_generate_files.py::test_generate_files_with_skip_if_file_exists PASSED [ 45%]
tests/test_generate_files.py::test_generate_files_with_overwrite_if_exists FAILED [ 46%]
tests/test_generate_files.py::test_raise_undefined_variable_file_name FAILED [ 46%]
tests/test_generate_files.py::test_raise_undefined_variable_file_name_existing_project FAILED [ 46%]
tests/test_generate_files.py::test_raise_undefined_variable_file_content FAILED [ 46%]
tests/test_generate_files.py::test_raise_undefined_variable_dir_name FAILED [ 47%]
tests/test_generate_files.py::test_keep_project_dir_on_failure FAILED    [ 47%]
tests/test_generate_files.py::test_raise_undefined_variable_dir_name_existing_project FAILED [ 47%]
tests/test_generate_files.py::test_raise_undefined_variable_project_dir FAILED [ 47%]
tests/test_generate_hooks.py::test_ignore_hooks_dirs FAILED              [ 48%]
tests/test_generate_hooks.py::test_run_python_hooks FAILED               [ 48%]
tests/test_generate_hooks.py::test_run_python_hooks_cwd FAILED           [ 48%]
tests/test_generate_hooks.py::test_empty_hooks FAILED                    [ 49%]
tests/test_generate_hooks.py::test_oserror_hooks FAILED                  [ 49%]
tests/test_generate_hooks.py::test_run_failing_hook_removes_output_directory FAILED [ 49%]
tests/test_generate_hooks.py::test_run_failing_hook_preserves_existing_output_directory FAILED [ 49%]
tests/test_generate_hooks.py::test_run_shell_hooks PASSED                [ 50%]
tests/test_generate_hooks.py::test_run_shell_hooks_win SKIPPED (Win only
test)                                                                    [ 50%]
tests/test_generate_hooks.py::test_ignore_shell_hooks PASSED             [ 50%]
tests/test_generate_hooks.py::test_deprecate_run_hook_from_repo_dir FAILED [ 50%]
tests/test_get_config.py::test_merge_configs PASSED                      [ 51%]
tests/test_get_config.py::test_get_config PASSED                         [ 51%]
tests/test_get_config.py::test_get_config_does_not_exist PASSED          [ 51%]
tests/test_get_config.py::test_invalid_config PASSED                     [ 52%]
tests/test_get_config.py::test_get_config_with_defaults PASSED           [ 52%]
tests/test_get_config.py::test_get_config_empty_config_file PASSED       [ 52%]
tests/test_get_config.py::test_get_config_invalid_file_with_array_as_top_level_element PASSED [ 52%]
tests/test_get_config.py::test_get_config_invalid_file_with_multiple_docs PASSED [ 53%]
tests/test_get_user_config.py::test_get_user_config_valid PASSED         [ 53%]
tests/test_get_user_config.py::test_get_user_config_invalid PASSED       [ 53%]
tests/test_get_user_config.py::test_get_user_config_nonexistent PASSED   [ 53%]
tests/test_get_user_config.py::test_specify_config_path PASSED           [ 54%]
tests/test_get_user_config.py::test_default_config_path PASSED           [ 54%]
tests/test_get_user_config.py::test_default_config_from_env_variable PASSED [ 54%]
tests/test_get_user_config.py::test_force_default_config PASSED          [ 54%]
tests/test_get_user_config.py::test_expand_user_for_directories_in_config PASSED [ 55%]
tests/test_get_user_config.py::test_expand_vars_for_directories_in_config PASSED [ 55%]
tests/test_get_user_config.py::test_specify_config_values PASSED         [ 55%]
tests/test_hooks.py::TestFindHooks::test_find_hook PASSED                [ 56%]
tests/test_hooks.py::TestFindHooks::test_no_hooks PASSED                 [ 56%]
tests/test_hooks.py::TestFindHooks::test_unknown_hooks_dir PASSED        [ 56%]
tests/test_hooks.py::TestFindHooks::test_hook_not_found PASSED           [ 56%]
tests/test_hooks.py::TestExternalHooks::test_run_script PASSED           [ 57%]
tests/test_hooks.py::TestExternalHooks::test_run_failing_script PASSED   [ 57%]
tests/test_hooks.py::TestExternalHooks::test_run_failing_script_enoexec PASSED [ 57%]
tests/test_hooks.py::TestExternalHooks::test_run_script_cwd PASSED       [ 57%]
tests/test_hooks.py::TestExternalHooks::test_run_script_with_context PASSED [ 58%]
tests/test_hooks.py::TestExternalHooks::test_run_hook PASSED             [ 58%]
tests/test_hooks.py::TestExternalHooks::test_run_failing_hook PASSED     [ 58%]
tests/test_hooks.py::test_ignore_hook_backup_files PASSED                [ 59%]
tests/test_log.py::test_info_stdout_logging FAILED                       [ 59%]
tests/test_log.py::test_debug_stdout_logging FAILED                      [ 59%]
tests/test_log.py::test_debug_file_logging FAILED                        [ 59%]
tests/test_main.py::test_original_cookiecutter_options_preserved_in__cookiecutter PASSED [ 60%]
tests/test_main.py::test_replay_dump_template_name FAILED                [ 60%]
tests/test_main.py::test_replay_load_template_name FAILED                [ 60%]
tests/test_main.py::test_custom_replay_file FAILED                       [ 60%]
tests/test_output_folder.py::test_output_folder FAILED                   [ 61%]
tests/test_output_folder.py::test_exception_when_output_folder_exists PASSED [ 61%]
tests/test_pre_prompt_hooks.py::test_run_pre_prompt_python_hook FAILED   [ 61%]
tests/test_pre_prompt_hooks.py::test_run_pre_prompt_python_hook_fail FAILED [ 61%]
tests/test_pre_prompt_hooks.py::test_run_pre_prompt_shell_hook PASSED    [ 62%]
tests/test_preferred_encoding.py::test_not_ascii PASSED                  [ 62%]
tests/test_prompt.py::TestRenderVariable::test_convert_to_str[1-1] FAILED [ 62%]
tests/test_prompt.py::TestRenderVariable::test_convert_to_str[True-True] PASSED [ 63%]
tests/test_prompt.py::TestRenderVariable::test_convert_to_str[foo-foo] PASSED [ 63%]
tests/test_prompt.py::TestRenderVariable::test_convert_to_str[{{cookiecutter.project}}-foobar] PASSED [ 63%]
tests/test_prompt.py::TestRenderVariable::test_convert_to_str[None-None] PASSED [ 63%]
tests/test_prompt.py::TestRenderVariable::test_convert_to_str_complex_variables[raw_var0-rendered_var0] FAILED [ 64%]
tests/test_prompt.py::TestRenderVariable::test_convert_to_str_complex_variables[raw_var1-rendered_var1] FAILED [ 64%]
tests/test_prompt.py::TestRenderVariable::test_convert_to_str_complex_variables[raw_var2-rendered_var2] PASSED [ 64%]
tests/test_prompt.py::TestPrompt::test_prompt_for_config[ASCII default prompt/input] FAILED [ 64%]
tests/test_prompt.py::TestPrompt::test_prompt_for_config[Unicode default prompt/input] FAILED [ 65%]
tests/test_prompt.py::TestPrompt::test_prompt_for_config_with_human_prompts[ASCII default prompt/input] FAILED [ 65%]
tests/test_prompt.py::TestPrompt::test_prompt_for_config_with_human_choices[context0] FAILED [ 65%]
tests/test_prompt.py::TestPrompt::test_prompt_for_config_with_human_choices[context1] FAILED [ 66%]
tests/test_prompt.py::TestPrompt::test_prompt_for_config_with_human_choices[context2] FAILED [ 66%]
tests/test_prompt.py::TestPrompt::test_prompt_for_config_dict FAILED     [ 66%]
tests/test_prompt.py::TestPrompt::test_should_render_dict FAILED         [ 66%]
tests/test_prompt.py::TestPrompt::test_should_render_deep_dict FAILED    [ 67%]
tests/test_prompt.py::TestPrompt::test_should_render_deep_dict_with_human_prompts FAILED [ 67%]
tests/test_prompt.py::TestPrompt::test_internal_use_no_human_prompts FAILED [ 67%]
tests/test_prompt.py::TestPrompt::test_prompt_for_templated_config FAILED [ 67%]
tests/test_prompt.py::TestPrompt::test_dont_prompt_for_private_context_var FAILED [ 68%]
tests/test_prompt.py::TestPrompt::test_should_render_private_variables_with_two_underscores FAILED [ 68%]
tests/test_prompt.py::TestPrompt::test_should_not_render_private_variables FAILED [ 68%]
tests/test_prompt.py::TestReadUserChoice::test_should_invoke_read_user_choice FAILED [ 69%]
tests/test_prompt.py::TestReadUserChoice::test_should_invoke_read_user_variable FAILED [ 69%]
tests/test_prompt.py::TestReadUserChoice::test_should_render_choices FAILED [ 69%]
tests/test_prompt.py::TestPromptChoiceForConfig::test_should_return_first_option_if_no_input FAILED [ 69%]
tests/test_prompt.py::TestPromptChoiceForConfig::test_should_read_user_choice FAILED [ 70%]
tests/test_prompt.py::TestReadUserYesNo::test_should_invoke_read_user_yes_no[True] FAILED [ 70%]
tests/test_prompt.py::TestReadUserYesNo::test_should_invoke_read_user_yes_no[False] FAILED [ 70%]
tests/test_prompt.py::TestReadUserYesNo::test_boolean_parameter_no_input FAILED [ 70%]
tests/test_prompt.py::test_undefined_variable[Undefined variable in cookiecutter dict] FAILED [ 71%]
tests/test_prompt.py::test_undefined_variable[Undefined variable in cookiecutter dict with choices] FAILED [ 71%]
tests/test_prompt.py::test_undefined_variable[Undefined variable in cookiecutter dict with dict_key] FAILED [ 71%]
tests/test_prompt.py::test_undefined_variable[Undefined variable in cookiecutter dict with key_value] FAILED [ 71%]
tests/test_prompt.py::test_cookiecutter_nested_templates[fake-nested-templates-fake-project] FAILED [ 72%]
tests/test_prompt.py::test_cookiecutter_nested_templates[fake-nested-templates-old-style-fake-package] FAILED [ 72%]
tests/test_prompt.py::test_cookiecutter_nested_templates_invalid_paths[] FAILED [ 72%]
tests/test_prompt.py::test_cookiecutter_nested_templates_invalid_paths[/tmp] FAILED [ 73%]
tests/test_prompt.py::test_cookiecutter_nested_templates_invalid_paths[/foo] FAILED [ 73%]
tests/test_prompt.py::test_cookiecutter_nested_templates_invalid_win_paths[] SKIPPED [ 73%]
tests/test_prompt.py::test_cookiecutter_nested_templates_invalid_win_paths[C:/tmp] SKIPPED [ 73%]
tests/test_prompt.py::test_cookiecutter_nested_templates_invalid_win_paths[D:/tmp] SKIPPED [ 74%]
tests/test_prompt.py::test_prompt_should_ask_and_rm_repo_dir FAILED      [ 74%]
tests/test_prompt.py::test_prompt_should_ask_and_exit_on_user_no_answer FAILED [ 74%]
tests/test_prompt.py::test_prompt_should_ask_and_rm_repo_file FAILED     [ 74%]
tests/test_prompt.py::test_prompt_should_ask_and_keep_repo_on_no_reuse FAILED [ 75%]
tests/test_prompt.py::test_prompt_should_ask_and_keep_repo_on_reuse FAILED [ 75%]
tests/test_prompt.py::test_prompt_should_not_ask_if_no_input_and_rm_repo_dir FAILED [ 75%]
tests/test_prompt.py::test_prompt_should_not_ask_if_no_input_and_rm_repo_file FAILED [ 76%]
tests/test_read_repo_password.py::test_click_invocation PASSED           [ 76%]
tests/test_read_user_choice.py::test_click_invocation[1-hello] FAILED    [ 76%]
tests/test_read_user_choice.py::test_click_invocation[2-world] FAILED    [ 76%]
tests/test_read_user_choice.py::test_click_invocation[3-foo] FAILED      [ 77%]
tests/test_read_user_choice.py::test_click_invocation[4-bar] FAILED      [ 77%]
tests/test_read_user_choice.py::test_raise_if_options_is_not_a_non_empty_list FAILED [ 77%]
tests/test_read_user_dict.py::test_process_json_invalid_json FAILED      [ 77%]
tests/test_read_user_dict.py::test_process_json_non_dict FAILED          [ 78%]
tests/test_read_user_dict.py::test_process_json_valid_json PASSED        [ 78%]
tests/test_read_user_dict.py::test_process_json_deep_dict PASSED         [ 78%]
tests/test_read_user_dict.py::test_should_raise_type_error FAILED        [ 78%]
tests/test_read_user_dict.py::test_should_call_prompt_with_process_json FAILED [ 79%]
tests/test_read_user_dict.py::test_should_not_load_json_from_sentinel PASSED [ 79%]
tests/test_read_user_dict.py::test_read_user_dict_default_value[\n] PASSED [ 79%]
tests/test_read_user_dict.py::test_read_user_dict_default_value[\ndefault\n] PASSED [ 80%]
tests/test_read_user_dict.py::test_json_prompt_process_response PASSED   [ 80%]
tests/test_read_user_variable.py::test_click_invocation PASSED           [ 80%]
tests/test_read_user_variable.py::test_input_loop_with_null_default_value FAILED [ 80%]
tests/test_read_user_yes_no.py::test_click_invocation PASSED             [ 81%]
tests/test_read_user_yes_no.py::test_yesno_prompt_process_response PASSED [ 81%]
tests/test_repo_not_found.py::test_should_raise_error_if_repo_does_not_exist PASSED [ 81%]
tests/test_specify_output_dir.py::test_api_invocation FAILED             [ 81%]
tests/test_specify_output_dir.py::test_default_output_dir FAILED         [ 82%]
tests/test_templates.py::test_build_templates[include] FAILED            [ 82%]
tests/test_templates.py::test_build_templates[no-templates] PASSED       [ 82%]
tests/test_templates.py::test_build_templates[extends] FAILED            [ 83%]
tests/test_templates.py::test_build_templates[super] FAILED              [ 83%]
tests/test_time_extension.py::test_tz_is_required PASSED                 [ 83%]
tests/test_time_extension.py::test_utc_default_datetime_format FAILED    [ 83%]
tests/test_time_extension.py::test_accept_valid_timezones[utc] FAILED    [ 84%]
tests/test_time_extension.py::test_accept_valid_timezones[local] FAILED  [ 84%]
tests/test_time_extension.py::test_accept_valid_timezones[Europe/Berlin] FAILED [ 84%]
tests/test_time_extension.py::test_environment_datetime_format FAILED    [ 84%]
tests/test_time_extension.py::test_add_time FAILED                       [ 85%]
tests/test_time_extension.py::test_substract_time FAILED                 [ 85%]
tests/test_time_extension.py::test_offset_with_format FAILED             [ 85%]
tests/test_utils.py::test_force_delete PASSED                            [ 85%]
tests/test_utils.py::test_rmtree PASSED                                  [ 86%]
tests/test_utils.py::test_make_sure_path_exists PASSED                   [ 86%]
tests/test_utils.py::test_make_sure_path_exists_correctly_handle_os_error PASSED [ 86%]
tests/test_utils.py::test_work_in PASSED                                 [ 87%]
tests/test_utils.py::test_work_in_without_path PASSED                    [ 87%]
tests/test_utils.py::test_create_tmp_repo_dir PASSED                     [ 87%]
tests/vcs/test_clone.py::test_clone_should_raise_if_vcs_not_installed PASSED [ 87%]
tests/vcs/test_clone.py::test_clone_should_rstrip_trailing_slash_in_repo_url FAILED [ 88%]
tests/vcs/test_clone.py::test_clone_should_abort_if_user_does_not_want_to_reclone FAILED [ 88%]
tests/vcs/test_clone.py::test_clone_should_silent_exit_if_ok_to_reuse PASSED [ 88%]
tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[git-https://github.com/hello/world.git-world] FAILED [ 88%]
tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[hg-https://bitbucket.org/foo/bar-bar] FAILED [ 89%]
tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[git-git@host:gitoliterepo-gitoliterepo] FAILED [ 89%]
tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[git-git@gitlab.com:cookiecutter/cookiecutter.git-cookiecutter] FAILED [ 89%]
tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[git-git@github.com:cookiecutter/cookiecutter.git-cookiecutter] FAILED [ 90%]
tests/vcs/test_clone.py::test_clone_handles_repo_typo[fatal: repository 'https://github.com/hackebro/cookiedozer' not found] FAILED [ 90%]
tests/vcs/test_clone.py::test_clone_handles_repo_typo[hg: abort: HTTP Error 404: Not Found] FAILED [ 90%]
tests/vcs/test_clone.py::test_clone_handles_branch_typo[error: pathspec 'unknown_branch' did not match any file(s) known to git] FAILED [ 90%]
tests/vcs/test_clone.py::test_clone_handles_branch_typo[hg: abort: unknown revision 'unknown_branch'!] FAILED [ 91%]
tests/vcs/test_clone.py::test_clone_unknown_subprocess_error FAILED      [ 91%]
tests/vcs/test_identify_repo.py::test_identify_known_repo[git+https://github.com/pytest-dev/cookiecutter-pytest-plugin.git-git-https://github.com/pytest-dev/cookiecutter-pytest-plugin.git] PASSED [ 91%]
tests/vcs/test_identify_repo.py::test_identify_known_repo[hg+https://bitbucket.org/foo/bar.hg-hg-https://bitbucket.org/foo/bar.hg] PASSED [ 91%]
tests/vcs/test_identify_repo.py::test_identify_known_repo[https://github.com/pytest-dev/cookiecutter-pytest-plugin.git-git-https://github.com/pytest-dev/cookiecutter-pytest-plugin.git] PASSED [ 92%]
tests/vcs/test_identify_repo.py::test_identify_known_repo[https://bitbucket.org/foo/bar.hg-hg-https://bitbucket.org/foo/bar.hg] PASSED [ 92%]
tests/vcs/test_identify_repo.py::test_identify_known_repo[https://github.com/audreyfeldroy/cookiecutter-pypackage.git-git-https://github.com/audreyfeldroy/cookiecutter-pypackage.git] PASSED [ 92%]
tests/vcs/test_identify_repo.py::test_identify_known_repo[https://github.com/audreyfeldroy/cookiecutter-pypackage-git-https://github.com/audreyfeldroy/cookiecutter-pypackage] PASSED [ 92%]
tests/vcs/test_identify_repo.py::test_identify_known_repo[git@gitorious.org:cookiecutter-gitorious/cookiecutter-gitorious.git-git-git@gitorious.org:cookiecutter-gitorious/cookiecutter-gitorious.git] PASSED [ 93%]
tests/vcs/test_identify_repo.py::test_identify_known_repo[https://audreyr@bitbucket.org/audreyr/cookiecutter-bitbucket-hg-https://audreyr@bitbucket.org/audreyr/cookiecutter-bitbucket] PASSED [ 93%]
tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[foo+git] FAILED [ 93%]
tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[foo+hg] FAILED [ 94%]
tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[foo+bar] FAILED [ 94%]
tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[foobar] FAILED [ 94%]
tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[http://norepotypespecified.com] FAILED [ 94%]
tests/vcs/test_is_vcs_installed.py::test_is_vcs_installed[-False] FAILED [ 95%]
tests/vcs/test_is_vcs_installed.py::test_is_vcs_installed[None-False] PASSED [ 95%]
tests/vcs/test_is_vcs_installed.py::test_is_vcs_installed[False-False] FAILED [ 95%]
tests/vcs/test_is_vcs_installed.py::test_is_vcs_installed[/usr/local/bin/git-True] PASSED [ 95%]
tests/zipfile/test_unzip.py::test_unzip_local_file PASSED                [ 96%]
tests/zipfile/test_unzip.py::test_unzip_protected_local_file_environment_password PASSED [ 96%]
tests/zipfile/test_unzip.py::test_unzip_protected_local_file_bad_environment_password PASSED [ 96%]
tests/zipfile/test_unzip.py::test_unzip_protected_local_file_user_password_with_noinput FAILED [ 97%]
tests/zipfile/test_unzip.py::test_unzip_protected_local_file_user_password PASSED [ 97%]
tests/zipfile/test_unzip.py::test_unzip_protected_local_file_user_bad_password PASSED [ 97%]
tests/zipfile/test_unzip.py::test_empty_zip_file FAILED                  [ 97%]
tests/zipfile/test_unzip.py::test_non_repo_zip_file FAILED               [ 98%]
tests/zipfile/test_unzip.py::test_bad_zip_file PASSED                    [ 98%]
tests/zipfile/test_unzip.py::test_unzip_url FAILED                       [ 98%]
tests/zipfile/test_unzip.py::test_unzip_url_with_empty_chunks FAILED     [ 98%]
tests/zipfile/test_unzip.py::test_unzip_url_existing_cache FAILED        [ 99%]
tests/zipfile/test_unzip.py::test_unzip_url_existing_cache_no_input FAILED [ 99%]
tests/zipfile/test_unzip.py::test_unzip_should_abort_if_no_redownload FAILED [ 99%]
tests/zipfile/test_unzip.py::test_unzip_is_ok_to_reuse FAILED            [100%]

=================================== FAILURES ===================================
____________________ test_should_find_existing_cookiecutter ____________________

template = 'cookiecutter-pytest-plugin'
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay'}
cloned_cookiecutter_path = '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin/my-dir'

    def test_should_find_existing_cookiecutter(
        template, user_config_data, cloned_cookiecutter_path
    ):
        """Find `cookiecutter.json` in sub folder created by `cloned_cookiecutter_path`."""
        project_dir, cleanup = repository.determine_repo_dir(
            template=template,
            abbreviations={},
            clone_to_dir=user_config_data['cookiecutters_dir'],
            checkout=None,
            no_input=True,
            directory='my-dir',
        )
    
>       assert cloned_cookiecutter_path == project_dir
E       AssertionError: assert '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin/my-dir' == '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin'
E         
E         - /tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin
E         + /tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin/my-dir
E         ?                                                                                      +++++++

tests/repository/test_determine_repo_dir_finds_subdirectories.py:47: AssertionError
_____________________________ test_local_repo_typo _____________________________

template = 'cookiecutter-pytest-plugin'
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay'}
cloned_cookiecutter_path = '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin/my-dir'

    def test_local_repo_typo(template, user_config_data, cloned_cookiecutter_path):
        """Wrong pointing to `cookiecutter.json` sub-directory should raise."""
>       with pytest.raises(exceptions.RepositoryNotFound) as err:
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.RepositoryNotFound'>

tests/repository/test_determine_repo_dir_finds_subdirectories.py:53: Failed
____________________________ test_finds_local_repo _____________________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_finds_local_repo0')

    def test_finds_local_repo(tmp_path):
        """A valid local repository should be returned."""
        project_dir, cleanup = repository.determine_repo_dir(
            'tests/fake-repo',
            abbreviations={},
            clone_to_dir=str(tmp_path),
            checkout=None,
            no_input=True,
        )
    
>       assert 'tests/fake-repo' == project_dir
E       AssertionError: assert 'tests/fake-repo' == '/workspace/cookiecutter/tests/fake-repo'
E         
E         - /workspace/cookiecutter/tests/fake-repo
E         + tests/fake-repo

tests/repository/test_determine_repository_should_use_local_repo.py:20: AssertionError
____________________ test_local_repo_with_no_context_raises ____________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_local_repo_with_no_contex0')

    def test_local_repo_with_no_context_raises(tmp_path):
        """A local repository without a cookiecutter.json should raise a \
        `RepositoryNotFound` exception."""
        template_path = str(Path('tests', 'fake-repo-bad'))
        with pytest.raises(exceptions.RepositoryNotFound) as err:
            repository.determine_repo_dir(
                template_path,
                abbreviations={},
                clone_to_dir=str(tmp_path),
                checkout=None,
                no_input=True,
            )
    
>       assert str(err.value) == (
            'A valid repository for "{}" could not be found in the following '
            'locations:\n{}'.format(
                template_path,
                '\n'.join(
                    [template_path, str(tmp_path.joinpath('tests', 'fake-repo-bad'))]
                ),
            )
        )
E       assert 'A valid repository for "tests/fake-repo-bad" could not be found in the following locations:\n/workspace/cookiecutter/tests/fake-repo-bad' == 'A valid repository for "tests/fake-repo-bad" could not be found in the following locations:\ntests/fake-repo-bad\n/tmp/pytest-of-openhands/pytest-30/test_local_repo_with_no_contex0/tests/fake-repo-bad'
E         
E           A valid repository for "tests/fake-repo-bad" could not be found in the following locations:
E         + /workspace/cookiecutter/tests/fake-repo-bad
E         - tests/fake-repo-bad
E         - /tmp/pytest-of-openhands/pytest-30/test_local_repo_with_no_contex0/tests/fake-repo-bad

tests/repository/test_determine_repository_should_use_local_repo.py:37: AssertionError
_____________________________ test_local_repo_typo _____________________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_local_repo_typo1')

    def test_local_repo_typo(tmp_path):
        """An unknown local repository should raise a `RepositoryNotFound` \
        exception."""
        template_path = str(Path('tests', 'unknown-repo'))
        with pytest.raises(exceptions.RepositoryNotFound) as err:
            repository.determine_repo_dir(
                template_path,
                abbreviations={},
                clone_to_dir=str(tmp_path),
                checkout=None,
                no_input=True,
            )
    
>       assert str(err.value) == (
            'A valid repository for "{}" could not be found in the following '
            'locations:\n{}'.format(
                template_path,
                '\n'.join([template_path, str(tmp_path.joinpath('tests', 'unknown-repo'))]),
            )
        )
E       assert 'A valid repository for "tests/unknown-repo" could not be found in the following locations:\ntests/unknown-repo' == 'A valid repository for "tests/unknown-repo" could not be found in the following locations:\ntests/unknown-repo\n/tmp/pytest-of-openhands/pytest-30/test_local_repo_typo1/tests/unknown-repo'
E         
E           A valid repository for "tests/unknown-repo" could not be found in the following locations:
E         - tests/unknown-repo
E         ?                   -
E         + tests/unknown-repo
E         - /tmp/pytest-of-openhands/pytest-30/test_local_repo_typo1/tests/unknown-repo

tests/repository/test_determine_repository_should_use_local_repo.py:61: AssertionError
_____________________________ test_cli_version[-V] _____________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
version_cli_flag = '-V'

    def test_cli_version(cli_runner, version_cli_flag):
        """Verify Cookiecutter version output by `cookiecutter` on cli invocation."""
        result = cli_runner(version_cli_flag)
        assert result.exit_code == 0
>       assert result.output.startswith('Cookiecutter')
E       AssertionError: assert False
E        +  where False = <built-in method startswith of str object at 0x7c8ac1d9abf0>('Cookiecutter')
E        +    where <built-in method startswith of str object at 0x7c8ac1d9abf0> = 'main, version 2.6.0\n'.startswith
E        +      where 'main, version 2.6.0\n' = <Result okay>.output

tests/test_cli.py:72: AssertionError
_________________________ test_cli_version[--version] __________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
version_cli_flag = '--version'

    def test_cli_version(cli_runner, version_cli_flag):
        """Verify Cookiecutter version output by `cookiecutter` on cli invocation."""
        result = cli_runner(version_cli_flag)
        assert result.exit_code == 0
>       assert result.output.startswith('Cookiecutter')
E       AssertionError: assert False
E        +  where False = <built-in method startswith of str object at 0x7c8ac199eba0>('Cookiecutter')
E        +    where <built-in method startswith of str object at 0x7c8ac199eba0> = 'main, version 2.6.0\n'.startswith
E        +      where 'main, version 2.6.0\n' = <Result okay>.output

tests/test_cli.py:72: AssertionError
_________________ test_cli_error_on_existing_output_directory __________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('make_fake_project_dir', 'remove_fake_project_dir')
    def test_cli_error_on_existing_output_directory(cli_runner):
        """Test cli invocation without `overwrite-if-exists` fail if dir exist."""
        result = cli_runner('tests/fake-repo-pre/', '--no-input')
>       assert result.exit_code != 0
E       assert 0 != 0
E        +  where 0 = <Result okay>.exit_code

tests/test_cli.py:79: AssertionError
___________________________________ test_cli ___________________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli(cli_runner):
        """Test cli invocation work without flags if directory not exist."""
        result = cli_runner('tests/fake-repo-pre/', '--no-input')
        assert result.exit_code == 0
>       assert os.path.isdir('fake-project')
E       AssertionError: assert False
E        +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
E        +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

tests/test_cli.py:89: AssertionError
_______________________________ test_cli_verbose _______________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_verbose(cli_runner):
        """Test cli invocation display log if called with `verbose` flag."""
        result = cli_runner('tests/fake-repo-pre/', '--no-input', '-v')
        assert result.exit_code == 0
>       assert os.path.isdir('fake-project')
E       AssertionError: assert False
E        +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
E        +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

tests/test_cli.py:99: AssertionError
_______________________________ test_cli_replay ________________________________

self = <MagicMock name='cookiecutter' id='136935401683360'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1f972b0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_replay(mocker, cli_runner):
        """Test cli invocation display log with `verbose` and `replay` flags."""
        mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(template_path, '--replay', '-v')
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=True,
            overwrite_if_exists=False,
            skip_if_file_exists=False,
            output_dir='.',
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:113: AssertionError
_____________________________ test_cli_replay_file _____________________________

self = <MagicMock name='cookiecutter' id='136935393472816'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac17c34c0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_replay_file(mocker, cli_runner):
        """Test cli invocation correctly pass --replay-file option."""
        mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(template_path, '--replay-file', '~/custom-replay-file', '-v')
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay='~/custom-replay-file',
            overwrite_if_exists=False,
            skip_if_file_exists=False,
            output_dir='.',
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:140: AssertionError
__________________________ test_cli_replay_generated ___________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1737b50>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_tmp_dir')
    def test_cli_replay_generated(mocker, cli_runner):
        """Test cli invocation correctly generates a project with replay."""
        template_path = 'tests/fake-repo-replay/'
        result = cli_runner(
            template_path,
            '--replay-file',
            'tests/test-replay/valid_replay.json',
            '-o',
            'tests/tmp/',
            '-v',
        )
        assert result.exit_code == 0
>       assert open('tests/tmp/replay-project/README.md').read().strip() == 'replayed'
E       FileNotFoundError: [Errno 2] No such file or directory: 'tests/tmp/replay-project/README.md'

tests/test_cli.py:171: FileNotFoundError
_____________________ test_cli_exit_on_noinput_and_replay ______________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac2241cc0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_exit_on_noinput_and_replay(mocker, cli_runner):
        """Test cli invocation fail if both `no-input` and `replay` flags passed."""
        mock_cookiecutter = mocker.patch(
            'cookiecutter.cli.cookiecutter', side_effect=cookiecutter
        )
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(template_path, '--no-input', '--replay', '-v')
    
>       assert result.exit_code == 1
E       assert 0 == 1
E        +  where 0 = <Result okay>.exit_code

tests/test_cli.py:184: AssertionError
_________ test_run_cookiecutter_on_overwrite_if_exists_and_replay[-f] __________

self = <MagicMock name='cookiecutter' id='136935404690000'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac2276410>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
overwrite_cli_flag = '-f'

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_run_cookiecutter_on_overwrite_if_exists_and_replay(
        mocker, cli_runner, overwrite_cli_flag
    ):
        """Test cli invocation with `overwrite-if-exists` and `replay` flags."""
        mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(template_path, '--replay', '-v', overwrite_cli_flag)
    
        assert result.exit_code == 0
    
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=True,
            overwrite_if_exists=True,
            skip_if_file_exists=False,
            output_dir='.',
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:228: AssertionError
_ test_run_cookiecutter_on_overwrite_if_exists_and_replay[--overwrite-if-exists] _

self = <MagicMock name='cookiecutter' id='136935399980480'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1df7a00>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
overwrite_cli_flag = '--overwrite-if-exists'

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_run_cookiecutter_on_overwrite_if_exists_and_replay(
        mocker, cli_runner, overwrite_cli_flag
    ):
        """Test cli invocation with `overwrite-if-exists` and `replay` flags."""
        mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(template_path, '--replay', '-v', overwrite_cli_flag)
    
        assert result.exit_code == 0
    
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=True,
            overwrite_if_exists=True,
            skip_if_file_exists=False,
            output_dir='.',
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:228: AssertionError
_______ test_cli_overwrite_if_exists_when_output_dir_does_not_exist[-f] ________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
overwrite_cli_flag = '-f'

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_overwrite_if_exists_when_output_dir_does_not_exist(
        cli_runner, overwrite_cli_flag
    ):
        """Test cli invocation with `overwrite-if-exists` and `no-input` flags.
    
        Case when output dir not exist.
        """
        result = cli_runner('tests/fake-repo-pre/', '--no-input', overwrite_cli_flag)
    
        assert result.exit_code == 0
>       assert os.path.isdir('fake-project')
E       AssertionError: assert False
E        +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
E        +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

tests/test_cli.py:257: AssertionError
_ test_cli_overwrite_if_exists_when_output_dir_does_not_exist[--overwrite-if-exists] _

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
overwrite_cli_flag = '--overwrite-if-exists'

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_overwrite_if_exists_when_output_dir_does_not_exist(
        cli_runner, overwrite_cli_flag
    ):
        """Test cli invocation with `overwrite-if-exists` and `no-input` flags.
    
        Case when output dir not exist.
        """
        result = cli_runner('tests/fake-repo-pre/', '--no-input', overwrite_cli_flag)
    
        assert result.exit_code == 0
>       assert os.path.isdir('fake-project')
E       AssertionError: assert False
E        +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
E        +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

tests/test_cli.py:257: AssertionError
___________________________ test_cli_output_dir[-o] ____________________________

self = <MagicMock name='cookiecutter' id='136935401684320'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1f97dc0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_output_dir__o_0/output'

    def test_cli_output_dir(mocker, cli_runner, output_dir_flag, output_dir):
        """Test cli invocation with `output-dir` flag changes output directory."""
        mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(template_path, output_dir_flag, output_dir)
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            skip_if_file_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:285: AssertionError
______________________ test_cli_output_dir[--output-dir] _______________________

self = <MagicMock name='cookiecutter' id='136935400403824'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e5dea0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_output_dir___output_d0/output'

    def test_cli_output_dir(mocker, cli_runner, output_dir_flag, output_dir):
        """Test cli invocation with `output-dir` flag changes output directory."""
        mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(template_path, output_dir_flag, output_dir)
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            skip_if_file_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:285: AssertionError
_____________________________ test_cli_help[help] ______________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
help_cli_flag = 'help'

    def test_cli_help(cli_runner, help_cli_flag):
        """Test cli invocation display help message with `help` flag."""
        result = cli_runner(help_cli_flag)
        assert result.exit_code == 0
>       assert result.output.startswith('Usage')
E       AssertionError: assert False
E        +  where False = <built-in method startswith of str object at 0x7c8ac4650030>('Usage')
E        +    where <built-in method startswith of str object at 0x7c8ac4650030> = ''.startswith
E        +      where '' = <Result okay>.output

tests/test_cli.py:313: AssertionError
_______________________________ test_user_config _______________________________

self = <MagicMock name='cookiecutter' id='136935400599424'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': '/tmp/pytest-of-openhands/pytest-30/test_user_config0/tests/config.yaml', 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e8f070>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
user_config_path = '/tmp/pytest-of-openhands/pytest-30/test_user_config0/tests/config.yaml'

    def test_user_config(mocker, cli_runner, user_config_path):
        """Test cli invocation works with `config-file` option."""
        mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(template_path, '--config-file', user_config_path)
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            skip_if_file_exists=False,
            output_dir='.',
            config_file=user_config_path,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:330: AssertionError
______________________ test_default_user_config_overwrite ______________________

self = <MagicMock name='cookiecutter' id='136935400261424'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': '/tmp/pytest-of-openhands/pytest-30/test_default_user_config_overw0/tests/config.yaml', 'default_config': True, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e3cdf0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
user_config_path = '/tmp/pytest-of-openhands/pytest-30/test_default_user_config_overw0/tests/config.yaml'

    def test_default_user_config_overwrite(mocker, cli_runner, user_config_path):
        """Test cli invocation ignores `config-file` if `default-config` passed."""
        mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(
            template_path,
            '--config-file',
            user_config_path,
            '--default-config',
        )
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            skip_if_file_exists=False,
            output_dir='.',
            config_file=user_config_path,
            default_config=True,
            extra_context=None,
            password=None,
            directory=None,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:361: AssertionError
___________________________ test_default_user_config ___________________________

self = <MagicMock name='cookiecutter' id='136935399919664'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': True, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1dea8c0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    def test_default_user_config(mocker, cli_runner):
        """Test cli invocation accepts `default-config` flag correctly."""
        mock_cookiecutter = mocker.patch('cookiecutter.cli.cookiecutter')
    
        template_path = 'tests/fake-repo-pre/'
        result = cli_runner(template_path, '--default-config')
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            skip_if_file_exists=False,
            output_dir='.',
            config_file=None,
            default_config=True,
            extra_context=None,
            password=None,
            directory=None,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:387: AssertionError
______________________ test_echo_undefined_variable_error ______________________

output_dir = '/tmp/pytest-of-openhands/pytest-30/test_echo_undefined_variable_e0/output'
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    def test_echo_undefined_variable_error(output_dir, cli_runner):
        """Cli invocation return error if variable undefined in template."""
        template_path = 'tests/undefined-variable/file-name/'
    
        result = cli_runner(
            '--no-input',
            '--default-config',
            '--output-dir',
            output_dir,
            template_path,
        )
    
>       assert result.exit_code == 1
E       assert 0 == 1
E        +  where 0 = <Result okay>.exit_code

tests/test_cli.py:417: AssertionError
______________________ test_echo_unknown_extension_error _______________________

output_dir = '/tmp/pytest-of-openhands/pytest-30/test_echo_unknown_extension_er0/output'
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    def test_echo_unknown_extension_error(output_dir, cli_runner):
        """Cli return error if extension incorrectly defined in template."""
        template_path = 'tests/test-extensions/unknown/'
    
        result = cli_runner(
            '--no-input',
            '--default-config',
            '--output-dir',
            output_dir,
            template_path,
        )
    
>       assert result.exit_code == 1
E       assert 0 == 1
E        +  where 0 = <Result okay>.exit_code

tests/test_cli.py:457: AssertionError
_____________________________ test_local_extension _____________________________

tmpdir = local('/tmp/pytest-of-openhands/pytest-30/test_local_extension0')
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    def test_local_extension(tmpdir, cli_runner):
        """Test to verify correct work of extension, included in template."""
        output_dir = str(tmpdir.mkdir('output'))
        template_path = 'tests/test-extensions/local_extension/'
    
        result = cli_runner(
            '--no-input',
            '--default-config',
            '--output-dir',
            output_dir,
            template_path,
        )
        assert result.exit_code == 0
>       content = Path(output_dir, 'Foobar', 'HISTORY.rst').read_text()

tests/test_cli.py:475: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_local_extension0/output/Foobar/HISTORY.rst')
mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-openhands/pytest-30/test_local_extension0/output/Foobar/HISTORY.rst'

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError
____________________________ test_cli_extra_context ____________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_extra_context(cli_runner):
        """Cli invocation replace content if called with replacement pairs."""
        result = cli_runner(
            'tests/fake-repo-pre/',
            '--no-input',
            '-v',
            'project_name=Awesomez',
        )
        assert result.exit_code == 0
>       assert os.path.isdir('fake-project')
E       AssertionError: assert False
E        +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
E        +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

tests/test_cli.py:500: AssertionError
____________________ test_cli_extra_context_invalid_format _____________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_extra_context_invalid_format(cli_runner):
        """Cli invocation raise error if called with unknown argument."""
        result = cli_runner(
            'tests/fake-repo-pre/',
            '--no-input',
            '-v',
            'ExtraContextWithNoEqualsSoInvalid',
        )
>       assert result.exit_code == 2
E       assert 0 == 2
E        +  where 0 = <Result okay>.exit_code

tests/test_cli.py:514: AssertionError
_________________________ test_debug_file_non_verbose __________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
debug_file = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_debug_file_non_verbose0/fake-repo.log')

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_debug_file_non_verbose(cli_runner, debug_file):
        """Test cli invocation writes log to `debug-file` if flag enabled.
    
        Case for normal log output.
        """
        assert not debug_file.exists()
    
        result = cli_runner(
            '--no-input',
            '--debug-file',
            str(debug_file),
            'tests/fake-repo-pre/',
        )
        assert result.exit_code == 0
    
>       assert debug_file.exists()
E       AssertionError: assert False
E        +  where False = exists()
E        +    where exists = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_debug_file_non_verbose0/fake-repo.log').exists

tests/test_cli.py:541: AssertionError
___________________________ test_debug_file_verbose ____________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
debug_file = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_debug_file_verbose0/fake-repo.log')

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_debug_file_verbose(cli_runner, debug_file):
        """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()
E       AssertionError: assert False
E        +  where False = exists()
E        +    where exists = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_debug_file_verbose0/fake-repo.log').exists

tests/test_cli.py:568: AssertionError
_____________________ test_debug_list_installed_templates ______________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
debug_file = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_debug_list_installed_temp0/fake-repo.log')
user_config_path = '/tmp/pytest-of-openhands/pytest-30/test_debug_list_installed_temp0/tests/config.yaml'

    @pytest.mark.usefixtures('make_fake_project_dir', 'remove_fake_project_dir')
    def test_debug_list_installed_templates(cli_runner, debug_file, user_config_path):
        """Verify --list-installed command correct invocation."""
        fake_template_dir = os.path.dirname(os.path.abspath('fake-project'))
        os.makedirs(os.path.dirname(user_config_path))
        # Single quotes in YAML will not parse escape codes (\).
        Path(user_config_path).write_text(f"cookiecutters_dir: '{fake_template_dir}'")
        Path("fake-project", "cookiecutter.json").write_text('{}')
    
        result = cli_runner(
            '--list-installed',
            '--config-file',
            user_config_path,
            str(debug_file),
        )
    
>       assert "1 installed templates:" in result.output
E       AssertionError: assert '1 installed templates:' in ''
E        +  where '' = <Result okay>.output

tests/test_cli.py:594: AssertionError
_________________ test_debug_list_installed_templates_failure __________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
debug_file = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_debug_list_installed_temp1/fake-repo.log')
user_config_path = '/tmp/pytest-of-openhands/pytest-30/test_debug_list_installed_temp1/tests/config.yaml'

    def test_debug_list_installed_templates_failure(
        cli_runner, debug_file, user_config_path
    ):
        """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
E       AssertionError: assert 'Error: Cannot list installed templates.' in ''
E        +  where '' = <Result okay>.output

tests/test_cli.py:609: AssertionError
_____________________________ test_directory_repo ______________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_directory_repo(cli_runner):
        """Test cli invocation works with `directory` option."""
        result = cli_runner(
            'tests/fake-repo-dir/',
            '--no-input',
            '-v',
            '--directory=my-dir',
        )
        assert result.exit_code == 0
>       assert os.path.isdir("fake-project")
E       AssertionError: assert False
E        +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
E        +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

tests/test_cli.py:623: AssertionError
____________ test_cli_accept_hooks[-o---accept-hooks=yes-None-True] ____________

self = <MagicMock name='cookiecutter' id='136935400000864'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1dfe8c0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_accept_hooks__o___acc0/output'
accept_hooks_arg = '--accept-hooks=yes', user_input = None, expected = True

    @pytest.mark.parametrize(
        "accept_hooks_arg,user_input,expected", cli_accept_hook_arg_testdata
    )
    def test_cli_accept_hooks(
        mocker,
        cli_runner,
        output_dir_flag,
        output_dir,
        accept_hooks_arg,
        user_input,
        expected,
    ):
        """Test cli invocation works with `accept-hooks` option."""
        mock_cookiecutter = mocker.patch("cookiecutter.cli.cookiecutter")
    
        template_path = "tests/fake-repo-pre/"
        result = cli_runner(
            template_path, output_dir_flag, output_dir, accept_hooks_arg, input=user_input
        )
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            skip_if_file_exists=False,
            accept_hooks=expected,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:657: AssertionError
____________ test_cli_accept_hooks[-o---accept-hooks=no-None-False] ____________

self = <MagicMock name='cookiecutter' id='136935412629360'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac2a076d0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_accept_hooks__o___acc1/output'
accept_hooks_arg = '--accept-hooks=no', user_input = None, expected = False

    @pytest.mark.parametrize(
        "accept_hooks_arg,user_input,expected", cli_accept_hook_arg_testdata
    )
    def test_cli_accept_hooks(
        mocker,
        cli_runner,
        output_dir_flag,
        output_dir,
        accept_hooks_arg,
        user_input,
        expected,
    ):
        """Test cli invocation works with `accept-hooks` option."""
        mock_cookiecutter = mocker.patch("cookiecutter.cli.cookiecutter")
    
        template_path = "tests/fake-repo-pre/"
        result = cli_runner(
            template_path, output_dir_flag, output_dir, accept_hooks_arg, input=user_input
        )
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            skip_if_file_exists=False,
            accept_hooks=expected,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:657: AssertionError
____________ test_cli_accept_hooks[-o---accept-hooks=ask-yes-True] _____________

self = <MagicMock name='cookiecutter' id='136935400099360'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e15060>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_accept_hooks__o___acc2/output'
accept_hooks_arg = '--accept-hooks=ask', user_input = 'yes', expected = True

    @pytest.mark.parametrize(
        "accept_hooks_arg,user_input,expected", cli_accept_hook_arg_testdata
    )
    def test_cli_accept_hooks(
        mocker,
        cli_runner,
        output_dir_flag,
        output_dir,
        accept_hooks_arg,
        user_input,
        expected,
    ):
        """Test cli invocation works with `accept-hooks` option."""
        mock_cookiecutter = mocker.patch("cookiecutter.cli.cookiecutter")
    
        template_path = "tests/fake-repo-pre/"
        result = cli_runner(
            template_path, output_dir_flag, output_dir, accept_hooks_arg, input=user_input
        )
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            skip_if_file_exists=False,
            accept_hooks=expected,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:657: AssertionError
____________ test_cli_accept_hooks[-o---accept-hooks=ask-no-False] _____________

self = <MagicMock name='cookiecutter' id='136935392847824'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac172afb0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_accept_hooks__o___acc3/output'
accept_hooks_arg = '--accept-hooks=ask', user_input = 'no', expected = False

    @pytest.mark.parametrize(
        "accept_hooks_arg,user_input,expected", cli_accept_hook_arg_testdata
    )
    def test_cli_accept_hooks(
        mocker,
        cli_runner,
        output_dir_flag,
        output_dir,
        accept_hooks_arg,
        user_input,
        expected,
    ):
        """Test cli invocation works with `accept-hooks` option."""
        mock_cookiecutter = mocker.patch("cookiecutter.cli.cookiecutter")
    
        template_path = "tests/fake-repo-pre/"
        result = cli_runner(
            template_path, output_dir_flag, output_dir, accept_hooks_arg, input=user_input
        )
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            skip_if_file_exists=False,
            accept_hooks=expected,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:657: AssertionError
_______ test_cli_accept_hooks[--output-dir---accept-hooks=yes-None-True] _______

self = <MagicMock name='cookiecutter' id='136935400396384'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e5cfa0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_accept_hooks___output0/output'
accept_hooks_arg = '--accept-hooks=yes', user_input = None, expected = True

    @pytest.mark.parametrize(
        "accept_hooks_arg,user_input,expected", cli_accept_hook_arg_testdata
    )
    def test_cli_accept_hooks(
        mocker,
        cli_runner,
        output_dir_flag,
        output_dir,
        accept_hooks_arg,
        user_input,
        expected,
    ):
        """Test cli invocation works with `accept-hooks` option."""
        mock_cookiecutter = mocker.patch("cookiecutter.cli.cookiecutter")
    
        template_path = "tests/fake-repo-pre/"
        result = cli_runner(
            template_path, output_dir_flag, output_dir, accept_hooks_arg, input=user_input
        )
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            skip_if_file_exists=False,
            accept_hooks=expected,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:657: AssertionError
_______ test_cli_accept_hooks[--output-dir---accept-hooks=no-None-False] _______

self = <MagicMock name='cookiecutter' id='136935393576080'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac17dc130>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_accept_hooks___output1/output'
accept_hooks_arg = '--accept-hooks=no', user_input = None, expected = False

    @pytest.mark.parametrize(
        "accept_hooks_arg,user_input,expected", cli_accept_hook_arg_testdata
    )
    def test_cli_accept_hooks(
        mocker,
        cli_runner,
        output_dir_flag,
        output_dir,
        accept_hooks_arg,
        user_input,
        expected,
    ):
        """Test cli invocation works with `accept-hooks` option."""
        mock_cookiecutter = mocker.patch("cookiecutter.cli.cookiecutter")
    
        template_path = "tests/fake-repo-pre/"
        result = cli_runner(
            template_path, output_dir_flag, output_dir, accept_hooks_arg, input=user_input
        )
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            skip_if_file_exists=False,
            accept_hooks=expected,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:657: AssertionError
_______ test_cli_accept_hooks[--output-dir---accept-hooks=ask-yes-True] ________

self = <MagicMock name='cookiecutter' id='136935400335936'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e4c580>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_accept_hooks___output2/output'
accept_hooks_arg = '--accept-hooks=ask', user_input = 'yes', expected = True

    @pytest.mark.parametrize(
        "accept_hooks_arg,user_input,expected", cli_accept_hook_arg_testdata
    )
    def test_cli_accept_hooks(
        mocker,
        cli_runner,
        output_dir_flag,
        output_dir,
        accept_hooks_arg,
        user_input,
        expected,
    ):
        """Test cli invocation works with `accept-hooks` option."""
        mock_cookiecutter = mocker.patch("cookiecutter.cli.cookiecutter")
    
        template_path = "tests/fake-repo-pre/"
        result = cli_runner(
            template_path, output_dir_flag, output_dir, accept_hooks_arg, input=user_input
        )
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            skip_if_file_exists=False,
            accept_hooks=expected,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:657: AssertionError
_______ test_cli_accept_hooks[--output-dir---accept-hooks=ask-no-False] ________

self = <MagicMock name='cookiecutter' id='136935400131072'>
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}
msg = "Expected 'cookiecutter' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e1eec0>
cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_cli_accept_hooks___output3/output'
accept_hooks_arg = '--accept-hooks=ask', user_input = 'no', expected = False

    @pytest.mark.parametrize(
        "accept_hooks_arg,user_input,expected", cli_accept_hook_arg_testdata
    )
    def test_cli_accept_hooks(
        mocker,
        cli_runner,
        output_dir_flag,
        output_dir,
        accept_hooks_arg,
        user_input,
        expected,
    ):
        """Test cli invocation works with `accept-hooks` option."""
        mock_cookiecutter = mocker.patch("cookiecutter.cli.cookiecutter")
    
        template_path = "tests/fake-repo-pre/"
        result = cli_runner(
            template_path, output_dir_flag, output_dir, accept_hooks_arg, input=user_input
        )
    
        assert result.exit_code == 0
>       mock_cookiecutter.assert_called_once_with(
            template_path,
            None,
            False,
            replay=False,
            overwrite_if_exists=False,
            output_dir=output_dir,
            config_file=None,
            default_config=False,
            extra_context=None,
            password=None,
            directory=None,
            skip_if_file_exists=False,
            accept_hooks=expected,
            keep_project_on_failure=False,
        )
E       AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.

tests/test_cli.py:657: AssertionError
______________________ test_cli_with_json_decoding_error _______________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_with_json_decoding_error(cli_runner):
        """Test cli invocation with a malformed JSON file."""
        template_path = 'tests/fake-repo-bad-json/'
        result = cli_runner(template_path, '--no-input')
>       assert result.exit_code != 0
E       assert 0 != 0
E        +  where 0 = <Result okay>.exit_code

tests/test_cli.py:680: AssertionError
________________________ test_cli_with_pre_prompt_hook _________________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>

    @pytest.mark.usefixtures('remove_fake_project_dir')
    def test_cli_with_pre_prompt_hook(cli_runner):
        """Test cli invocation in a template with pre_prompt hook."""
        template_path = 'tests/test-pyhooks/'
        result = cli_runner(template_path, '--no-input')
        assert result.exit_code == 0
        dir_name = 'inputfake-project'
>       assert os.path.isdir(dir_name)
E       AssertionError: assert False
E        +  where False = <function isdir at 0x7c8ac455dfc0>('inputfake-project')
E        +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

tests/test_cli.py:701: AssertionError
______________________ test_cli_with_pre_prompt_hook_fail ______________________

cli_runner = <function cli_runner.<locals>.cli_main at 0x7c8ac1f5d7e0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac16c93c0>

    def test_cli_with_pre_prompt_hook_fail(cli_runner, monkeypatch):
        """Test cli invocation will fail when a given env var is present."""
        template_path = 'tests/test-pyhooks/'
        with monkeypatch.context() as m:
            m.setenv('COOKIECUTTER_FAIL_PRE_PROMPT', '1')
            result = cli_runner(template_path, '--no-input')
>       assert result.exit_code == 1
E       assert 0 == 1
E        +  where 0 = <Result okay>.exit_code

tests/test_cli.py:712: AssertionError
___________________________ test_should_invoke_main ____________________________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac1dc2f50>
project_dir = 'fake-project-templated'

    @pytest.mark.usefixtures('clean_system')
    def test_should_invoke_main(monkeypatch, project_dir):
        """Should create a project and exit with 0 code on cli invocation."""
        monkeypatch.setenv('PYTHONPATH', '.')
    
>       exit_code = subprocess.check_call(
            [sys.executable, '-m', 'cookiecutter.cli', 'tests/fake-repo-tmpl', '--no-input']
        )

tests/test_cookiecutter_invocation.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

popenargs = (['/usr/bin/python', '-m', 'cookiecutter.cli', 'tests/fake-repo-tmpl', '--no-input'],)
kwargs = {}, retcode = 1
cmd = ['/usr/bin/python', '-m', 'cookiecutter.cli', 'tests/fake-repo-tmpl', '--no-input']

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.
    
        The arguments are the same as for the call function.  Example:
    
        check_call(["ls", "-l"])
        """
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           subprocess.CalledProcessError: Command '['/usr/bin/python', '-m', 'cookiecutter.cli', 'tests/fake-repo-tmpl', '--no-input']' returned non-zero exit status 1.

/usr/lib/python3.10/subprocess.py:369: CalledProcessError
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/workspace/cookiecutter/cookiecutter/cli.py", line 6, in <module>
    import click
ModuleNotFoundError: No module named 'click'
_____ test_cookiecutter_no_input_return_project_dir[tests/fake-repo-pre/] ______

path = 'tests/fake-repo-pre/'

    @pytest.mark.parametrize('path', ['tests/fake-repo-pre/', 'tests/fake-repo-pre'])
    @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
    def test_cookiecutter_no_input_return_project_dir(path):
        """Verify `cookiecutter` create project dir on input with or without slash."""
        project_dir = main.cookiecutter(path, no_input=True)
        assert os.path.isdir('tests/fake-repo-pre/{{cookiecutter.repo_name}}')
        assert not os.path.isdir('tests/fake-repo-pre/fake-project')
        assert os.path.isdir(project_dir)
>       assert os.path.isfile('fake-project/README.rst')
E       AssertionError: assert False
E        +  where False = <function isfile at 0x7c8ac455df30>('fake-project/README.rst')
E        +    where <function isfile at 0x7c8ac455df30> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isfile
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

tests/test_cookiecutter_local_no_input.py:43: AssertionError
______ test_cookiecutter_no_input_return_project_dir[tests/fake-repo-pre] ______

path = 'tests/fake-repo-pre'

    @pytest.mark.parametrize('path', ['tests/fake-repo-pre/', 'tests/fake-repo-pre'])
    @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
    def test_cookiecutter_no_input_return_project_dir(path):
        """Verify `cookiecutter` create project dir on input with or without slash."""
        project_dir = main.cookiecutter(path, no_input=True)
        assert os.path.isdir('tests/fake-repo-pre/{{cookiecutter.repo_name}}')
        assert not os.path.isdir('tests/fake-repo-pre/fake-project')
        assert os.path.isdir(project_dir)
>       assert os.path.isfile('fake-project/README.rst')
E       AssertionError: assert False
E        +  where False = <function isfile at 0x7c8ac455df30>('fake-project/README.rst')
E        +    where <function isfile at 0x7c8ac455df30> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isfile
E        +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path

tests/test_cookiecutter_local_no_input.py:43: AssertionError
_____________________ test_cookiecutter_templated_context ______________________

    @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
    def test_cookiecutter_templated_context():
        """Verify Jinja2 templating correctly works in `cookiecutter.json` file."""
>       main.cookiecutter('tests/fake-repo-tmpl', no_input=True)

tests/test_cookiecutter_local_no_input.py:61: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:218: in generate_files
    project_dir = render_and_create_dir(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = '{{cookiecutter.repo_name}}'
context = OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))])
output_dir = '.'
environment = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e55d80>
overwrite_if_exists = False

    def render_and_create_dir(dirname: str, context: dict, output_dir: 'os.PathLike[str]', environment: Environment, overwrite_if_exists: bool=False):
        """Render name of a directory, create the directory, return its path."""
        # Render the directory name
        name_tmpl = environment.from_string(dirname)
        rendered_name = name_tmpl.render(**context)
    
        dir_to_create = Path(output_dir) / rendered_name
    
        # Check if directory already exists
        if dir_to_create.exists():
            if not overwrite_if_exists:
>               raise OutputDirExistsException(f"Output directory {dir_to_create} already exists")
E               cookiecutter.exceptions.OutputDirExistsException: Output directory {{ cookiecutter.project_name|lower|replace(' ', '-') }} already exists

cookiecutter/generate.py:174: OutputDirExistsException
_______________ test_cookiecutter_no_input_return_rendered_file ________________

    @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
    def test_cookiecutter_no_input_return_rendered_file():
        """Verify Jinja2 templating correctly works in `cookiecutter.json` file."""
        project_dir = main.cookiecutter('tests/fake-repo-pre', no_input=True)
>       assert project_dir == os.path.abspath('fake-project')
E       AssertionError: assert 'fake-project' == '/workspace/cookiecutter/fake-project'
E         
E         - /workspace/cookiecutter/fake-project
E         + fake-project

tests/test_cookiecutter_local_no_input.py:69: AssertionError
___________________ test_cookiecutter_dict_values_in_context ___________________

    @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
    def test_cookiecutter_dict_values_in_context():
        """Verify configured dictionary from `cookiecutter.json` correctly unpacked."""
        project_dir = main.cookiecutter('tests/fake-repo-dict', no_input=True)
>       assert project_dir == os.path.abspath('fake-project-dict')
E       AssertionError: assert 'fake-project-dict' == '/workspace/cookiecutter/fake-project-dict'
E         
E         - /workspace/cookiecutter/fake-project-dict
E         + fake-project-dict

tests/test_cookiecutter_local_no_input.py:78: AssertionError
______________________ test_cookiecutter_template_cleanup ______________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e163e0>

    @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
    def test_cookiecutter_template_cleanup(mocker):
        """Verify temporary folder for zip unpacking dropped."""
        mocker.patch('tempfile.mkdtemp', return_value='fake-tmp', autospec=True)
    
        mocker.patch(
            'cookiecutter.prompt.prompt_and_delete', return_value=True, autospec=True
        )
    
>       main.cookiecutter('tests/files/fake-repo-tmpl.zip', no_input=True)

tests/test_cookiecutter_local_no_input.py:133: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:218: in generate_files
    project_dir = render_and_create_dir(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dirname = '{{cookiecutter.repo_name}}'
context = OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))])
output_dir = '.'
environment = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e14460>
overwrite_if_exists = False

    def render_and_create_dir(dirname: str, context: dict, output_dir: 'os.PathLike[str]', environment: Environment, overwrite_if_exists: bool=False):
        """Render name of a directory, create the directory, return its path."""
        # Render the directory name
        name_tmpl = environment.from_string(dirname)
        rendered_name = name_tmpl.render(**context)
    
        dir_to_create = Path(output_dir) / rendered_name
    
        # Check if directory already exists
        if dir_to_create.exists():
            if not overwrite_if_exists:
>               raise OutputDirExistsException(f"Output directory {dir_to_create} already exists")
E               cookiecutter.exceptions.OutputDirExistsException: Output directory {{ cookiecutter.project_name|lower|replace(' ', '-') }} already exists

cookiecutter/generate.py:174: OutputDirExistsException
______________________ test_cookiecutter_local_with_input ______________________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac1735840>

    @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
    def test_cookiecutter_local_with_input(monkeypatch):
        """Verify simple cookiecutter run results, without extra_context provided."""
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_variable',
            lambda var, default, prompts, prefix: default,
        )
>       main.cookiecutter('tests/fake-repo-pre/', no_input=False)

tests/test_cookiecutter_local_with_input.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:94: in cookiecutter
    context = prompt_for_config(context, no_input=no_input)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project'), ('repo_name', 'fake-project'), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))])
no_input = False

    def prompt_for_config(context, no_input=False):
        """Prompt user to enter a new config.
    
        :param dict context: Source for field names and sample values.
        :param no_input: Do not prompt for user input and use only values from context.
        """
        cookiecutter_dict = OrderedDict()
        env = create_env_with_context(context)
    
        for key, raw in context['cookiecutter'].items():
            if key.startswith('_'):
                cookiecutter_dict[key] = raw
                continue
    
            if isinstance(raw, list):
                # Choice variable
                val = read_user_choice(key, raw) if not no_input else raw[0]
            elif isinstance(raw, bool):
                # Boolean variable
                val = read_user_yes_no(key, raw) if not no_input else raw
            elif isinstance(raw, dict):
                # Dictionary variable
                val = read_user_dict(key, raw) if not no_input else raw
            else:
                # Regular string variable
>               val = read_user_variable(key, raw) if not no_input else raw
E               TypeError: test_cookiecutter_local_with_input.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'

cookiecutter/prompt.py:175: TypeError
____________________ test_cookiecutter_input_extra_context _____________________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac17c1780>

    @pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
    def test_cookiecutter_input_extra_context(monkeypatch):
        """Verify simple cookiecutter run results, with extra_context provided."""
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_variable',
            lambda var, default, prompts, prefix: default,
        )
>       main.cookiecutter(
            'tests/fake-repo-pre',
            no_input=False,
            extra_context={'repo_name': 'fake-project-input-extra'},
        )

tests/test_cookiecutter_local_with_input.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:94: in cookiecutter
    context = prompt_for_config(context, no_input=no_input)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project'), ('repo_name', 'fake-project-input-extra'), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))])
no_input = False

    def prompt_for_config(context, no_input=False):
        """Prompt user to enter a new config.
    
        :param dict context: Source for field names and sample values.
        :param no_input: Do not prompt for user input and use only values from context.
        """
        cookiecutter_dict = OrderedDict()
        env = create_env_with_context(context)
    
        for key, raw in context['cookiecutter'].items():
            if key.startswith('_'):
                cookiecutter_dict[key] = raw
                continue
    
            if isinstance(raw, list):
                # Choice variable
                val = read_user_choice(key, raw) if not no_input else raw[0]
            elif isinstance(raw, bool):
                # Boolean variable
                val = read_user_yes_no(key, raw) if not no_input else raw
            elif isinstance(raw, dict):
                # Dictionary variable
                val = read_user_dict(key, raw) if not no_input else raw
            else:
                # Regular string variable
>               val = read_user_variable(key, raw) if not no_input else raw
E               TypeError: test_cookiecutter_input_extra_context.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'

cookiecutter/prompt.py:175: TypeError
____ test_cookiecutter_nested_templates[fake-nested-templates-fake-project] ____

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac16c9ba0>
template_dir = 'fake-nested-templates', output_dir = 'fake-project'

    @pytest.mark.parametrize(
        "template_dir,output_dir",
        [
            ["fake-nested-templates", "fake-project"],
            ["fake-nested-templates-old-style", "fake-package"],
        ],
    )
    def test_cookiecutter_nested_templates(mocker, template_dir: str, output_dir: str):
        """Verify cookiecutter nested configuration files mechanism."""
        mock_generate_files = mocker.patch("cookiecutter.main.generate_files")
        main_dir = (Path("tests") / template_dir).resolve()
        main.cookiecutter(f"{main_dir}", no_input=True)
        expected = (Path(main_dir) / output_dir).resolve()
>       assert mock_generate_files.call_args[1]["repo_dir"] == f"{expected}"
E       AssertionError: assert PosixPath('/tmp/tmpr3z7ekd5') == '/workspace/cookiecutter/tests/fake-nested-templates/fake-project'

tests/test_cookiecutter_nested_templates.py:23: AssertionError
_ test_cookiecutter_nested_templates[fake-nested-templates-old-style-fake-package] _

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac2274460>
template_dir = 'fake-nested-templates-old-style', output_dir = 'fake-package'

    @pytest.mark.parametrize(
        "template_dir,output_dir",
        [
            ["fake-nested-templates", "fake-project"],
            ["fake-nested-templates-old-style", "fake-package"],
        ],
    )
    def test_cookiecutter_nested_templates(mocker, template_dir: str, output_dir: str):
        """Verify cookiecutter nested configuration files mechanism."""
        mock_generate_files = mocker.patch("cookiecutter.main.generate_files")
        main_dir = (Path("tests") / template_dir).resolve()
        main.cookiecutter(f"{main_dir}", no_input=True)
        expected = (Path(main_dir) / output_dir).resolve()
>       assert mock_generate_files.call_args[1]["repo_dir"] == f"{expected}"
E       AssertionError: assert PosixPath('/tmp/tmpxcvyjq3x') == '/workspace/cookiecutter/tests/fake-nested-templates-old-style/fake-package'

tests/test_cookiecutter_nested_templates.py:23: AssertionError
____________________ test_hook_with_extension[pre_gen_hook] ____________________

script_path = PosixPath('/tmp/tmpwyvoute2/hooks/pre_gen_project.py')
cwd = '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_pre_g0/output/foobar'
context = OrderedDict([('cookiecutter', OrderedDict([('project_slug', 'foobar'), ('name', 'Cookiemonster'), ('_extensions', ['hello_extension.HelloExtension'])])), ('_cookiecutter', OrderedDict([('project_slug', 'foobar'), ('name', 'Cookiemonster'), ('_extensions', ['hello_extension.HelloExtension'])]))])

    def run_script_with_context(script_path, cwd, context):
        """Execute a script after rendering it with Jinja.
    
        :param script_path: Absolute path to the script to run.
        :param cwd: The directory to run the script from.
        :param context: Cookiecutter project template context.
        """
        script_path = Path(script_path)
    
        if context:
            env = create_env_with_context(context)
            template = env.from_string(script_path.read_text())
            rendered_script = template.render(**context)
        else:
            rendered_script = script_path.read_text()
    
        with tempfile.NamedTemporaryFile(
            mode='w', suffix=script_path.suffix, delete=False, dir=cwd
        ) as temp_script:
            temp_script.write(rendered_script)
            temp_script_path = Path(temp_script.name)
    
        utils.make_executable(temp_script_path)
    
        try:
>           proc = subprocess.Popen(
                [str(temp_script_path)],
                cwd=cwd,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
            )

cookiecutter/hooks.py:93: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/subprocess.py:971: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Popen: returncode: 255 args: ['/tmp/pytest-of-openhands/pytest-30/test_hook...>
args = ['/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_pre_g0/output/foobar/tmp28p0rorh.py']
executable = b'/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_pre_g0/output/foobar/tmp28p0rorh.py'
preexec_fn = None, close_fds = True, pass_fds = ()
cwd = '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_pre_g0/output/foobar'
env = None, startupinfo = None, creationflags = 0, shell = False, p2cread = -1
p2cwrite = -1, c2pread = 11, c2pwrite = 12, errread = 13, errwrite = 14
restore_signals = True, gid = None, gids = None, uid = None, umask = -1
start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       restore_signals,
                       gid, gids, uid, umask,
                       start_new_session):
        """Execute program (POSIX version)"""
    
        if isinstance(args, (str, bytes)):
            args = [args]
        elif isinstance(args, os.PathLike):
            if shell:
                raise TypeError('path-like args is not allowed when '
                                'shell is true')
            args = [args]
        else:
            args = list(args)
    
        if shell:
            # On Android the default shell is at '/system/bin/sh'.
            unix_shell = ('/system/bin/sh' if
                      hasattr(sys, 'getandroidapilevel') else '/bin/sh')
            args = [unix_shell, "-c"] + args
            if executable:
                args[0] = executable
    
        if executable is None:
            executable = args[0]
    
        sys.audit("subprocess.Popen", executable, args, cwd, env)
    
        if (_USE_POSIX_SPAWN
                and os.path.dirname(executable)
                and preexec_fn is None
                and not close_fds
                and not pass_fds
                and cwd is None
                and (p2cread == -1 or p2cread > 2)
                and (c2pwrite == -1 or c2pwrite > 2)
                and (errwrite == -1 or errwrite > 2)
                and not start_new_session
                and gid is None
                and gids is None
                and uid is None
                and umask < 0):
            self._posix_spawn(args, executable, env, restore_signals,
                              p2cread, p2cwrite,
                              c2pread, c2pwrite,
                              errread, errwrite)
            return
    
        orig_executable = executable
    
        # For transferring possible exec failure from child to parent.
        # Data format: "exception name:hex errno:description"
        # Pickle is not used; it is complex and involves memory allocation.
        errpipe_read, errpipe_write = os.pipe()
        # errpipe_write must not be in the standard io 0, 1, or 2 fd range.
        low_fds_to_close = []
        while errpipe_write < 3:
            low_fds_to_close.append(errpipe_write)
            errpipe_write = os.dup(errpipe_write)
        for low_fd in low_fds_to_close:
            os.close(low_fd)
        try:
            try:
                # We must avoid complex work that could involve
                # malloc or free in the child process to avoid
                # potential deadlocks, thus we do all this here.
                # and pass it to fork_exec()
    
                if env is not None:
                    env_list = []
                    for k, v in env.items():
                        k = os.fsencode(k)
                        if b'=' in k:
                            raise ValueError("illegal environment variable name")
                        env_list.append(k + b'=' + os.fsencode(v))
                else:
                    env_list = None  # Use execv instead of execve.
                executable = os.fsencode(executable)
                if os.path.dirname(executable):
                    executable_list = (executable,)
                else:
                    # This matches the behavior of os._execvpe().
                    executable_list = tuple(
                        os.path.join(os.fsencode(dir), executable)
                        for dir in os.get_exec_path(env))
                fds_to_keep = set(pass_fds)
                fds_to_keep.add(errpipe_write)
                self.pid = _posixsubprocess.fork_exec(
                        args, executable_list,
                        close_fds, tuple(sorted(map(int, fds_to_keep))),
                        cwd, env_list,
                        p2cread, p2cwrite, c2pread, c2pwrite,
                        errread, errwrite,
                        errpipe_read, errpipe_write,
                        restore_signals, start_new_session,
                        gid, gids, uid, umask,
                        preexec_fn)
                self._child_created = True
            finally:
                # be sure the FD is closed no matter what
                os.close(errpipe_write)
    
            self._close_pipe_fds(p2cread, p2cwrite,
                                 c2pread, c2pwrite,
                                 errread, errwrite)
    
            # Wait for exec to fail or succeed; possibly raising an
            # exception (limited in size)
            errpipe_data = bytearray()
            while True:
                part = os.read(errpipe_read, 50000)
                errpipe_data += part
                if not part or len(errpipe_data) > 50000:
                    break
        finally:
            # be sure the FD is closed no matter what
            os.close(errpipe_read)
    
        if errpipe_data:
            try:
                pid, sts = os.waitpid(self.pid, 0)
                if pid == self.pid:
                    self._handle_exitstatus(sts)
                else:
                    self.returncode = sys.maxsize
            except ChildProcessError:
                pass
    
            try:
                exception_name, hex_errno, err_msg = (
                        errpipe_data.split(b':', 2))
                # The encoding here should match the encoding
                # written in by the subprocess implementations
                # like _posixsubprocess
                err_msg = err_msg.decode()
            except ValueError:
                exception_name = b'SubprocessError'
                hex_errno = b'0'
                err_msg = 'Bad exception data from child: {!r}'.format(
                              bytes(errpipe_data))
            child_exception_type = getattr(
                    builtins, exception_name.decode('ascii'),
                    SubprocessError)
            if issubclass(child_exception_type, OSError) and hex_errno:
                errno_num = int(hex_errno, 16)
                child_exec_never_called = (err_msg == "noexec")
                if child_exec_never_called:
                    err_msg = ""
                    # The error must be from chdir(cwd).
                    err_filename = cwd
                else:
                    err_filename = orig_executable
                if errno_num != 0:
                    err_msg = os.strerror(errno_num)
>               raise child_exception_type(errno_num, err_msg, err_filename)
E               OSError: [Errno 8] Exec format error: '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_pre_g0/output/foobar/tmp28p0rorh.py'

/usr/lib/python3.10/subprocess.py:1863: OSError

During handling of the above exception, another exception occurred:

template = 'tests/test-extensions/custom-extension-pre'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_pre_g0/output'

    def test_hook_with_extension(template, output_dir):
        """Verify custom Jinja2 extension correctly work in hooks and file rendering.
    
        Each file in hooks has simple tests inside and will raise error if not
        correctly rendered.
        """
>       project_dir = main.cookiecutter(
            template,
            no_input=True,
            output_dir=output_dir,
            extra_context={'project_slug': 'foobar', 'name': 'Cookiemonster'},
        )

tests/test_custom_extensions_in_hooks.py:36: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:228: in generate_files
    _run_hook_from_repo_dir(
cookiecutter/generate.py:192: in _run_hook_from_repo_dir
    run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context, delete_project_on_failure)
cookiecutter/hooks.py:141: in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

script_path = PosixPath('/tmp/tmpwyvoute2/hooks/pre_gen_project.py')
cwd = '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_pre_g0/output/foobar'
context = OrderedDict([('cookiecutter', OrderedDict([('project_slug', 'foobar'), ('name', 'Cookiemonster'), ('_extensions', ['hello_extension.HelloExtension'])])), ('_cookiecutter', OrderedDict([('project_slug', 'foobar'), ('name', 'Cookiemonster'), ('_extensions', ['hello_extension.HelloExtension'])]))])

    def run_script_with_context(script_path, cwd, context):
        """Execute a script after rendering it with Jinja.
    
        :param script_path: Absolute path to the script to run.
        :param cwd: The directory to run the script from.
        :param context: Cookiecutter project template context.
        """
        script_path = Path(script_path)
    
        if context:
            env = create_env_with_context(context)
            template = env.from_string(script_path.read_text())
            rendered_script = template.render(**context)
        else:
            rendered_script = script_path.read_text()
    
        with tempfile.NamedTemporaryFile(
            mode='w', suffix=script_path.suffix, delete=False, dir=cwd
        ) as temp_script:
            temp_script.write(rendered_script)
            temp_script_path = Path(temp_script.name)
    
        utils.make_executable(temp_script_path)
    
        try:
            proc = subprocess.Popen(
                [str(temp_script_path)],
                cwd=cwd,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
            )
            stdout, stderr = proc.communicate()
            if proc.returncode != EXIT_SUCCESS:
                raise FailedHookException(
                    f"Hook script failed (exit code: {proc.returncode})"
                )
        except OSError as err:
            if err.errno == errno.ENOEXEC:
>               raise FailedHookException(
                    'Hook script failed, might be an empty file or missing a shebang'
                )
E               cookiecutter.exceptions.FailedHookException: Hook script failed, might be an empty file or missing a shebang

cookiecutter/hooks.py:106: FailedHookException
___________________ test_hook_with_extension[post_gen_hook] ____________________

script_path = PosixPath('/tmp/tmpecutr1i2/hooks/post_gen_project.py')
cwd = '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_post_0/output/foobar'
context = OrderedDict([('cookiecutter', OrderedDict([('project_slug', 'foobar'), ('name', 'Cookiemonster'), ('_extensions', ['hello_extension.HelloExtension'])])), ('_cookiecutter', OrderedDict([('project_slug', 'foobar'), ('name', 'Cookiemonster'), ('_extensions', ['hello_extension.HelloExtension'])]))])

    def run_script_with_context(script_path, cwd, context):
        """Execute a script after rendering it with Jinja.
    
        :param script_path: Absolute path to the script to run.
        :param cwd: The directory to run the script from.
        :param context: Cookiecutter project template context.
        """
        script_path = Path(script_path)
    
        if context:
            env = create_env_with_context(context)
            template = env.from_string(script_path.read_text())
            rendered_script = template.render(**context)
        else:
            rendered_script = script_path.read_text()
    
        with tempfile.NamedTemporaryFile(
            mode='w', suffix=script_path.suffix, delete=False, dir=cwd
        ) as temp_script:
            temp_script.write(rendered_script)
            temp_script_path = Path(temp_script.name)
    
        utils.make_executable(temp_script_path)
    
        try:
>           proc = subprocess.Popen(
                [str(temp_script_path)],
                cwd=cwd,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
            )

cookiecutter/hooks.py:93: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/subprocess.py:971: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Popen: returncode: 255 args: ['/tmp/pytest-of-openhands/pytest-30/test_hook...>
args = ['/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_post_0/output/foobar/tmp2usnj75t.py']
executable = b'/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_post_0/output/foobar/tmp2usnj75t.py'
preexec_fn = None, close_fds = True, pass_fds = ()
cwd = '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_post_0/output/foobar'
env = None, startupinfo = None, creationflags = 0, shell = False, p2cread = -1
p2cwrite = -1, c2pread = 11, c2pwrite = 12, errread = 13, errwrite = 14
restore_signals = True, gid = None, gids = None, uid = None, umask = -1
start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       restore_signals,
                       gid, gids, uid, umask,
                       start_new_session):
        """Execute program (POSIX version)"""
    
        if isinstance(args, (str, bytes)):
            args = [args]
        elif isinstance(args, os.PathLike):
            if shell:
                raise TypeError('path-like args is not allowed when '
                                'shell is true')
            args = [args]
        else:
            args = list(args)
    
        if shell:
            # On Android the default shell is at '/system/bin/sh'.
            unix_shell = ('/system/bin/sh' if
                      hasattr(sys, 'getandroidapilevel') else '/bin/sh')
            args = [unix_shell, "-c"] + args
            if executable:
                args[0] = executable
    
        if executable is None:
            executable = args[0]
    
        sys.audit("subprocess.Popen", executable, args, cwd, env)
    
        if (_USE_POSIX_SPAWN
                and os.path.dirname(executable)
                and preexec_fn is None
                and not close_fds
                and not pass_fds
                and cwd is None
                and (p2cread == -1 or p2cread > 2)
                and (c2pwrite == -1 or c2pwrite > 2)
                and (errwrite == -1 or errwrite > 2)
                and not start_new_session
                and gid is None
                and gids is None
                and uid is None
                and umask < 0):
            self._posix_spawn(args, executable, env, restore_signals,
                              p2cread, p2cwrite,
                              c2pread, c2pwrite,
                              errread, errwrite)
            return
    
        orig_executable = executable
    
        # For transferring possible exec failure from child to parent.
        # Data format: "exception name:hex errno:description"
        # Pickle is not used; it is complex and involves memory allocation.
        errpipe_read, errpipe_write = os.pipe()
        # errpipe_write must not be in the standard io 0, 1, or 2 fd range.
        low_fds_to_close = []
        while errpipe_write < 3:
            low_fds_to_close.append(errpipe_write)
            errpipe_write = os.dup(errpipe_write)
        for low_fd in low_fds_to_close:
            os.close(low_fd)
        try:
            try:
                # We must avoid complex work that could involve
                # malloc or free in the child process to avoid
                # potential deadlocks, thus we do all this here.
                # and pass it to fork_exec()
    
                if env is not None:
                    env_list = []
                    for k, v in env.items():
                        k = os.fsencode(k)
                        if b'=' in k:
                            raise ValueError("illegal environment variable name")
                        env_list.append(k + b'=' + os.fsencode(v))
                else:
                    env_list = None  # Use execv instead of execve.
                executable = os.fsencode(executable)
                if os.path.dirname(executable):
                    executable_list = (executable,)
                else:
                    # This matches the behavior of os._execvpe().
                    executable_list = tuple(
                        os.path.join(os.fsencode(dir), executable)
                        for dir in os.get_exec_path(env))
                fds_to_keep = set(pass_fds)
                fds_to_keep.add(errpipe_write)
                self.pid = _posixsubprocess.fork_exec(
                        args, executable_list,
                        close_fds, tuple(sorted(map(int, fds_to_keep))),
                        cwd, env_list,
                        p2cread, p2cwrite, c2pread, c2pwrite,
                        errread, errwrite,
                        errpipe_read, errpipe_write,
                        restore_signals, start_new_session,
                        gid, gids, uid, umask,
                        preexec_fn)
                self._child_created = True
            finally:
                # be sure the FD is closed no matter what
                os.close(errpipe_write)
    
            self._close_pipe_fds(p2cread, p2cwrite,
                                 c2pread, c2pwrite,
                                 errread, errwrite)
    
            # Wait for exec to fail or succeed; possibly raising an
            # exception (limited in size)
            errpipe_data = bytearray()
            while True:
                part = os.read(errpipe_read, 50000)
                errpipe_data += part
                if not part or len(errpipe_data) > 50000:
                    break
        finally:
            # be sure the FD is closed no matter what
            os.close(errpipe_read)
    
        if errpipe_data:
            try:
                pid, sts = os.waitpid(self.pid, 0)
                if pid == self.pid:
                    self._handle_exitstatus(sts)
                else:
                    self.returncode = sys.maxsize
            except ChildProcessError:
                pass
    
            try:
                exception_name, hex_errno, err_msg = (
                        errpipe_data.split(b':', 2))
                # The encoding here should match the encoding
                # written in by the subprocess implementations
                # like _posixsubprocess
                err_msg = err_msg.decode()
            except ValueError:
                exception_name = b'SubprocessError'
                hex_errno = b'0'
                err_msg = 'Bad exception data from child: {!r}'.format(
                              bytes(errpipe_data))
            child_exception_type = getattr(
                    builtins, exception_name.decode('ascii'),
                    SubprocessError)
            if issubclass(child_exception_type, OSError) and hex_errno:
                errno_num = int(hex_errno, 16)
                child_exec_never_called = (err_msg == "noexec")
                if child_exec_never_called:
                    err_msg = ""
                    # The error must be from chdir(cwd).
                    err_filename = cwd
                else:
                    err_filename = orig_executable
                if errno_num != 0:
                    err_msg = os.strerror(errno_num)
>               raise child_exception_type(errno_num, err_msg, err_filename)
E               OSError: [Errno 8] Exec format error: '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_post_0/output/foobar/tmp2usnj75t.py'

/usr/lib/python3.10/subprocess.py:1863: OSError

During handling of the above exception, another exception occurred:

template = 'tests/test-extensions/custom-extension-post'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_post_0/output'

    def test_hook_with_extension(template, output_dir):
        """Verify custom Jinja2 extension correctly work in hooks and file rendering.
    
        Each file in hooks has simple tests inside and will raise error if not
        correctly rendered.
        """
>       project_dir = main.cookiecutter(
            template,
            no_input=True,
            output_dir=output_dir,
            extra_context={'project_slug': 'foobar', 'name': 'Cookiemonster'},
        )

tests/test_custom_extensions_in_hooks.py:36: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:283: in generate_files
    _run_hook_from_repo_dir(
cookiecutter/generate.py:192: in _run_hook_from_repo_dir
    run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context, delete_project_on_failure)
cookiecutter/hooks.py:141: in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

script_path = PosixPath('/tmp/tmpecutr1i2/hooks/post_gen_project.py')
cwd = '/tmp/pytest-of-openhands/pytest-30/test_hook_with_extension_post_0/output/foobar'
context = OrderedDict([('cookiecutter', OrderedDict([('project_slug', 'foobar'), ('name', 'Cookiemonster'), ('_extensions', ['hello_extension.HelloExtension'])])), ('_cookiecutter', OrderedDict([('project_slug', 'foobar'), ('name', 'Cookiemonster'), ('_extensions', ['hello_extension.HelloExtension'])]))])

    def run_script_with_context(script_path, cwd, context):
        """Execute a script after rendering it with Jinja.
    
        :param script_path: Absolute path to the script to run.
        :param cwd: The directory to run the script from.
        :param context: Cookiecutter project template context.
        """
        script_path = Path(script_path)
    
        if context:
            env = create_env_with_context(context)
            template = env.from_string(script_path.read_text())
            rendered_script = template.render(**context)
        else:
            rendered_script = script_path.read_text()
    
        with tempfile.NamedTemporaryFile(
            mode='w', suffix=script_path.suffix, delete=False, dir=cwd
        ) as temp_script:
            temp_script.write(rendered_script)
            temp_script_path = Path(temp_script.name)
    
        utils.make_executable(temp_script_path)
    
        try:
            proc = subprocess.Popen(
                [str(temp_script_path)],
                cwd=cwd,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
            )
            stdout, stderr = proc.communicate()
            if proc.returncode != EXIT_SUCCESS:
                raise FailedHookException(
                    f"Hook script failed (exit code: {proc.returncode})"
                )
        except OSError as err:
            if err.errno == errno.ENOEXEC:
>               raise FailedHookException(
                    'Hook script failed, might be an empty file or missing a shebang'
                )
E               cookiecutter.exceptions.FailedHookException: Hook script failed, might be an empty file or missing a shebang

cookiecutter/hooks.py:106: FailedHookException
__________________________ test_jinja2_time_extension __________________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_jinja2_time_extension0')

    def test_jinja2_time_extension(tmp_path):
        """Verify Jinja2 time extension work correctly."""
>       project_dir = cookiecutter(
            'tests/test-extensions/default/', no_input=True, output_dir=str(tmp_path)
        )

tests/test_default_extensions.py:24: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:268: in generate_files
    generate_file(
cookiecutter/generate.py:156: in generate_file
    tmpl = env.from_string(f.read())
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:4: TemplateSyntaxError
________________________ test_jinja2_slugify_extension _________________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_jinja2_slugify_extension0')

    def test_jinja2_slugify_extension(tmp_path):
        """Verify Jinja2 slugify extension work correctly."""
>       project_dir = cookiecutter(
            'tests/test-extensions/default/', no_input=True, output_dir=str(tmp_path)
        )

tests/test_default_extensions.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:268: in generate_files
    generate_file(
cookiecutter/generate.py:156: in generate_file
    tmpl = env.from_string(f.read())
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:4: TemplateSyntaxError
__________________________ test_jinja2_uuid_extension __________________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_jinja2_uuid_extension0')

    def test_jinja2_uuid_extension(tmp_path):
        """Verify Jinja2 uuid extension work correctly."""
>       project_dir = cookiecutter(
            'tests/test-extensions/default/', no_input=True, output_dir=str(tmp_path)
        )

tests/test_default_extensions.py:56: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:268: in generate_files
    generate_file(
cookiecutter/generate.py:156: in generate_file
    tmpl = env.from_string(f.read())
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:4: TemplateSyntaxError
_________________ test_generate_copy_without_render_extensions _________________

    @pytest.mark.usefixtures('clean_system', 'remove_test_dir')
    def test_generate_copy_without_render_extensions():
        """Verify correct work of `_copy_without_render` context option.
    
        Some files/directories should be rendered during invocation,
        some just copied, without any modification.
        """
        generate.generate_files(
            context={
                'cookiecutter': {
                    'repo_name': 'test_copy_without_render',
                    'render_test': 'I have been rendered!',
                    '_copy_without_render': [
                        '*not-rendered',
                        'rendered/not_rendered.yml',
                        '*.txt',
                        '{{cookiecutter.repo_name}}-rendered/README.md',
                    ],
                }
            },
            repo_dir='tests/test-generate-copy-without-render',
        )
    
        dir_contents = os.listdir('test_copy_without_render')
    
>       assert 'test_copy_without_render-not-rendered' in dir_contents
E       AssertionError: assert 'test_copy_without_render-not-rendered' in []

tests/test_generate_copy_without_render.py:44: AssertionError
_________________ test_generate_copy_without_render_extensions _________________

    @pytest.mark.usefixtures('clean_system', 'remove_test_dir')
    def test_generate_copy_without_render_extensions():
        """Verify correct work of `_copy_without_render` context option.
    
        Some files/directories should be rendered during invocation,
        some just copied, without any modification.
        """
        # first run
        generate.generate_files(
            context={
                'cookiecutter': {
                    'repo_name': 'test_copy_without_render',
                    'render_test': 'I have been rendered!',
                    '_copy_without_render': [
                        '*not-rendered',
                        'rendered/not_rendered.yml',
                        '*.txt',
                        '{{cookiecutter.repo_name}}-rendered/README.md',
                    ],
                }
            },
            repo_dir='tests/test-generate-copy-without-render-override',
        )
    
        # second run with override flag to True
        generate.generate_files(
            context={
                'cookiecutter': {
                    'repo_name': 'test_copy_without_render',
                    'render_test': 'I have been rendered!',
                    '_copy_without_render': [
                        '*not-rendered',
                        'rendered/not_rendered.yml',
                        '*.txt',
                        '{{cookiecutter.repo_name}}-rendered/README.md',
                    ],
                }
            },
            overwrite_if_exists=True,
            repo_dir='tests/test-generate-copy-without-render',
        )
    
        dir_contents = os.listdir('test_copy_without_render')
    
>       assert 'test_copy_without_render-not-rendered' in dir_contents
E       AssertionError: assert 'test_copy_without_render-not-rendered' in []

tests/test_generate_copy_without_render_override.py:63: AssertionError
___________________ test_generate_file_with_false_condition ____________________

env = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e176d0>

    def test_generate_file_with_false_condition(env):
        """Verify correct work of boolean condition in file name on file generation.
    
        This test has negative answer, so file should not be rendered.
        """
        infile = (
            'tests/files/{% if cookiecutter.generate_file == \'y\' %}cheese.txt{% endif %}'
        )
>       generate.generate_file(
            project_dir=".",
            infile=infile,
            context={'cookiecutter': {'generate_file': 'n'}},
            env=env,
        )

tests/test_generate_file.py:110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

project_dir = '.'
infile = "tests/files/{% if cookiecutter.generate_file == 'y' %}cheese.txt{% endif %}"
context = {'cookiecutter': {'generate_file': 'n'}}
env = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e176d0>
skip_if_file_exists = False

    def generate_file(project_dir, infile, context, env, skip_if_file_exists=False):
        """Render filename of infile as name of outfile, handle infile correctly.
    
        Dealing with infile appropriately:
    
            a. If infile is a binary file, copy it over without rendering.
            b. If infile is a text file, render its contents and write the
               rendered infile to outfile.
    
        Precondition:
    
            When calling `generate_file()`, the root template dir must be the
            current working directory. Using `utils.work_in()` is the recommended
            way to perform this directory change.
    
        :param project_dir: Absolute path to the resulting generated project.
        :param infile: Input file to generate the file from. Relative to the root
            template dir.
        :param context: Dict for populating the cookiecutter's variables.
        :param env: Jinja2 template execution environment.
        """
        infile_path = Path(infile)
    
        # Render the output file path
        outfile_tmpl = env.from_string(infile)
        outfile = outfile_tmpl.render(**context)
        outfile_path = Path(project_dir) / outfile
    
        # Create output directory if it doesn't exist
        make_sure_path_exists(outfile_path.parent)
    
        # Check if file exists and skip_if_file_exists is True
        if skip_if_file_exists and outfile_path.exists():
            logger.debug('Skipping file %s (already exists)', outfile_path)
            return
    
        # Determine if file is binary or text
        if is_binary(infile):
            # Copy binary file without rendering
            shutil.copy2(infile, outfile_path)
        else:
            # Render text file
            try:
                with open(infile) as f:
                    tmpl = env.from_string(f.read())
                rendered_file = tmpl.render(**context)
>               with open(outfile_path, 'w') as f:
E               IsADirectoryError: [Errno 21] Is a directory: 'tests/files'

cookiecutter/generate.py:158: IsADirectoryError
_______________ test_generate_file_verbose_template_syntax_error _______________

env = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e03a60>
expected_msg_regex = re.compile('Missing end of comment tag\n {2}File "(.[/\\\\])*tests[/\\\\]files[/\\\\]syntax_error.txt", line 1\n {4}I eat {{ syntax_error }} {# this comment is not closed}')

    def test_generate_file_verbose_template_syntax_error(env, expected_msg_regex):
        """Verify correct exception raised on syntax error in file before generation."""
        with pytest.raises(TemplateSyntaxError) as exception:
            generate.generate_file(
                project_dir=".",
                infile='tests/files/syntax_error.txt',
                context={'syntax_error': 'syntax_error'},
                env=env,
            )
>       assert expected_msg_regex.match(str(exception.value))
E       assert None
E        +  where None = <built-in method match of re.Pattern object at 0x56b4e85212f0>('Missing end of comment tag')
E        +    where <built-in method match of re.Pattern object at 0x56b4e85212f0> = re.compile('Missing end of comment tag\n {2}File "(.[/\\\\])*tests[/\\\\]files[/\\\\]syntax_error.txt", line 1\n {4}I eat {{ syntax_error }} {# this comment is not closed}').match
E        +    and   'Missing end of comment tag' = str(TemplateSyntaxError('Missing end of comment tag'))
E        +      where TemplateSyntaxError('Missing end of comment tag') = <ExceptionInfo TemplateSyntaxError('Missing end of comment tag') tblen=6>.value

tests/test_generate_file.py:138: AssertionError
__________ test_generate_file_does_not_translate_crlf_newlines_to_lf ___________

env = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e8ecb0>

    def test_generate_file_does_not_translate_crlf_newlines_to_lf(env):
        """Verify that file generation use same line ending, as in source file."""
        infile = 'tests/files/{{cookiecutter.generate_file}}_crlf_newlines.txt'
        generate.generate_file(
            project_dir=".",
            infile=infile,
            context={'cookiecutter': {'generate_file': 'cheese'}},
            env=env,
        )
    
        # this generated file should have a CRLF line ending
        gf = 'tests/files/cheese_crlf_newlines.txt'
        with Path(gf).open(encoding='utf-8', newline='') as f:
            simple_text = f.readline()
>       assert simple_text == 'newline is CRLF\r\n'
E       AssertionError: assert 'newline is CRLF\n' == 'newline is CRLF\r\n'
E         
E         - newline is CRLF
E         ?                -
E         + newline is CRLF

tests/test_generate_file.py:173: AssertionError
_____________________________ test_generate_files ______________________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files0')

    def test_generate_files(tmp_path):
        """Verify directory name correctly rendered with unicode containing context."""
        generate.generate_files(
            context={'cookiecutter': {'food': 'pizzä'}},
            repo_dir='tests/test-generate-files',
            output_dir=tmp_path,
        )
    
        simple_file = Path(tmp_path, 'inputpizzä/simple.txt')
        assert simple_file.exists()
        assert simple_file.is_file()
    
        simple_text = Path(simple_file).read_text(encoding='utf-8')
>       assert simple_text == 'I eat pizzä\n'
E       AssertionError: assert 'I eat pizzä' == 'I eat pizzä\n'
E         
E         - I eat pizzä
E         ?            -
E         + I eat pizzä

tests/test_generate_files.py:42: AssertionError
_____ test_generate_files_with_trailing_newline_forced_to_linux_by_context _____

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_with_trail0')

    def test_generate_files_with_trailing_newline_forced_to_linux_by_context(tmp_path):
        """Verify new line not removed by templating engine after folder generation."""
        generate.generate_files(
            context={'cookiecutter': {'food': 'pizzä', '_new_lines': '\r\n'}},
            repo_dir='tests/test-generate-files',
            output_dir=tmp_path,
        )
    
        # assert 'Overwritting endline character with %s' in caplog.messages
        newline_file = Path(tmp_path, 'inputpizzä/simple-with-newline.txt')
        assert newline_file.is_file()
        assert newline_file.exists()
    
        with Path(newline_file).open(encoding='utf-8', newline='') as f:
            simple_text = f.readline()
>       assert simple_text == 'newline is LF\r\n'
E       AssertionError: assert 'newline is LF\n' == 'newline is LF\r\n'
E         
E         - newline is LF
E         ?              -
E         + newline is LF

tests/test_generate_files.py:99: AssertionError
___________________ test_generate_files_with_windows_newline ___________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_with_windo0')

    def test_generate_files_with_windows_newline(tmp_path):
        """Verify windows source line end not changed during files generation."""
        generate.generate_files(
            context={'cookiecutter': {'food': 'pizzä'}},
            repo_dir='tests/test-generate-files',
            output_dir=tmp_path,
        )
    
        newline_file = Path(tmp_path, 'inputpizzä/simple-with-newline-crlf.txt')
        assert newline_file.is_file()
        assert newline_file.exists()
    
        with Path(newline_file).open(encoding='utf-8', newline='') as f:
            simple_text = f.readline()
>       assert simple_text == 'newline is CRLF\r\n'
E       AssertionError: assert 'newline is CRLF\n' == 'newline is CRLF\r\n'
E         
E         - newline is CRLF
E         ?                -
E         + newline is CRLF

tests/test_generate_files.py:117: AssertionError
_________________________ test_generate_files_binaries _________________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0')

    def test_generate_files_binaries(tmp_path):
        """Verify binary files created during directory generation."""
        generate.generate_files(
            context={'cookiecutter': {'binary_test': 'binary_files'}},
            repo_dir='tests/test-generate-binaries',
            output_dir=tmp_path,
        )
    
        dst_dir = Path(tmp_path, 'inputbinary_files')
    
        assert is_binary(str(Path(dst_dir, 'logo.png')))
>       assert is_binary(str(Path(dst_dir, '.DS_Store')))
E       AssertionError: assert False
E        +  where False = is_binary('/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files/.DS_Store')
E        +    where '/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files/.DS_Store' = str(PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files/.DS_Store'))
E        +      where PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files/.DS_Store') = Path(PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files'), '.DS_Store')

tests/test_generate_files.py:151: AssertionError
----------------------------- Captured stdout call -----------------------------
[Errno 2] No such file or directory: '/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files/.DS_Store'
_______________________ test_generate_files_permissions ________________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_permission0')

    def test_generate_files_permissions(tmp_path):
        """Verify generates files respect source files permissions.
    
        simple.txt and script.sh should retain their respective 0o644 and 0o755
        permissions.
        """
        generate.generate_files(
            context={'cookiecutter': {'permissions': 'permissions'}},
            repo_dir='tests/test-generate-files-permissions',
            output_dir=tmp_path,
        )
    
        assert Path(tmp_path, 'inputpermissions/simple.txt').is_file()
    
        # Verify source simple.txt should still be 0o644
        tests_simple_file = Path(
            'tests',
            'test-generate-files-permissions',
            'input{{cookiecutter.permissions}}',
            'simple.txt',
        )
        tests_simple_file_mode = tests_simple_file.stat().st_mode
    
        input_simple_file = Path(tmp_path, 'inputpermissions', 'simple.txt')
        input_simple_file_mode = input_simple_file.stat().st_mode
        assert tests_simple_file_mode == input_simple_file_mode
    
        assert Path(tmp_path, 'inputpermissions/script.sh').exists()
        assert Path(tmp_path, 'inputpermissions/script.sh').is_file()
    
        # Verify source script.sh should still be 0o755
        tests_script_file = Path(
            'tests',
            'test-generate-files-permissions',
            'input{{cookiecutter.permissions}}',
            'script.sh',
        )
        tests_script_file_mode = tests_script_file.stat().st_mode
    
        input_script_file = Path(tmp_path, 'inputpermissions', 'script.sh')
        input_script_file_mode = input_script_file.stat().st_mode
>       assert tests_script_file_mode == input_script_file_mode
E       assert 33261 == 33188

tests/test_generate_files.py:228: AssertionError
____ test_generate_files_with_overwrite_if_exists_with_skip_if_file_exists _____

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_with_overw0')

    def test_generate_files_with_overwrite_if_exists_with_skip_if_file_exists(tmp_path):
        """Verify `skip_if_file_exist` has priority over `overwrite_if_exists`."""
        simple_file = Path(tmp_path, 'inputpizzä/simple.txt')
        simple_with_new_line_file = Path(tmp_path, 'inputpizzä/simple-with-newline.txt')
    
        Path(tmp_path, 'inputpizzä').mkdir(parents=True)
        with Path(simple_file).open('w') as f:
            f.write('temp')
    
        generate.generate_files(
            context={'cookiecutter': {'food': 'pizzä'}},
            repo_dir='tests/test-generate-files',
            overwrite_if_exists=True,
            skip_if_file_exists=True,
            output_dir=tmp_path,
        )
    
        assert Path(simple_file).is_file()
        assert Path(simple_file).exists()
        assert Path(simple_with_new_line_file).is_file()
        assert Path(simple_with_new_line_file).exists()
    
        simple_text = Path(simple_file).read_text(encoding='utf-8')
>       assert simple_text == 'temp'
E       AssertionError: assert 'I eat pizzä' == 'temp'
E         
E         - temp
E         + I eat pizzä

tests/test_generate_files.py:254: AssertionError
_________________ test_generate_files_with_overwrite_if_exists _________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_with_overw1')

    def test_generate_files_with_overwrite_if_exists(tmp_path):
        """Verify overwrite_if_exists overwrites old files."""
        simple_file = Path(tmp_path, 'inputpizzä/simple.txt')
        simple_with_new_line_file = Path(tmp_path, 'inputpizzä/simple-with-newline.txt')
    
        Path(tmp_path, 'inputpizzä').mkdir(parents=True)
        Path(simple_file).write_text('temp')
    
        generate.generate_files(
            context={'cookiecutter': {'food': 'pizzä'}},
            repo_dir='tests/test-generate-files',
            overwrite_if_exists=True,
            output_dir=tmp_path,
        )
    
        assert Path(simple_file).is_file()
        assert Path(simple_file).exists()
        assert Path(simple_with_new_line_file).is_file()
        assert Path(simple_with_new_line_file).exists()
    
        simple_text = Path(simple_file).read_text(encoding='utf-8')
>       assert simple_text == 'I eat pizzä\n'
E       AssertionError: assert 'I eat pizzä' == 'I eat pizzä\n'
E         
E         - I eat pizzä
E         ?            -
E         + I eat pizzä

tests/test_generate_files.py:302: AssertionError
___________________ test_raise_undefined_variable_file_name ____________________

output_dir = '/tmp/pytest-of-openhands/pytest-30/test_raise_undefined_variable_0/output'
undefined_context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}

    def test_raise_undefined_variable_file_name(output_dir, undefined_context):
        """Verify correct error raised when file name cannot be rendered."""
        with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
>           generate.generate_files(
                repo_dir='tests/undefined-variable/file-name/',
                output_dir=output_dir,
                context=undefined_context,
            )

tests/test_generate_files.py:316: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:268: in generate_files
    generate_file(
cookiecutter/generate.py:137: in generate_file
    outfile = outfile_tmpl.render(**context)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'

<template>:1: UndefinedError
___________ test_raise_undefined_variable_file_name_existing_project ___________

output_dir = '/tmp/pytest-of-openhands/pytest-30/test_raise_undefined_variable_1/output'
undefined_context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}

    def test_raise_undefined_variable_file_name_existing_project(
        output_dir, undefined_context
    ):
        """Verify correct error raised when file name cannot be rendered."""
        testproj_path = Path(output_dir, 'testproject')
        testproj_path.mkdir()
    
        with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
>           generate.generate_files(
                repo_dir='tests/undefined-variable/file-name/',
                output_dir=output_dir,
                context=undefined_context,
                overwrite_if_exists=True,
            )

tests/test_generate_files.py:336: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:268: in generate_files
    generate_file(
cookiecutter/generate.py:137: in generate_file
    outfile = outfile_tmpl.render(**context)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'

<template>:1: UndefinedError
__________________ test_raise_undefined_variable_file_content __________________

project_dir = '/tmp/pytest-of-openhands/pytest-30/test_raise_undefined_variable_2/output/testproject'
infile = 'README.rst'
context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}
env = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e03a60>
skip_if_file_exists = False

    def generate_file(project_dir, infile, context, env, skip_if_file_exists=False):
        """Render filename of infile as name of outfile, handle infile correctly.
    
        Dealing with infile appropriately:
    
            a. If infile is a binary file, copy it over without rendering.
            b. If infile is a text file, render its contents and write the
               rendered infile to outfile.
    
        Precondition:
    
            When calling `generate_file()`, the root template dir must be the
            current working directory. Using `utils.work_in()` is the recommended
            way to perform this directory change.
    
        :param project_dir: Absolute path to the resulting generated project.
        :param infile: Input file to generate the file from. Relative to the root
            template dir.
        :param context: Dict for populating the cookiecutter's variables.
        :param env: Jinja2 template execution environment.
        """
        infile_path = Path(infile)
    
        # Render the output file path
        outfile_tmpl = env.from_string(infile)
        outfile = outfile_tmpl.render(**context)
        outfile_path = Path(project_dir) / outfile
    
        # Create output directory if it doesn't exist
        make_sure_path_exists(outfile_path.parent)
    
        # Check if file exists and skip_if_file_exists is True
        if skip_if_file_exists and outfile_path.exists():
            logger.debug('Skipping file %s (already exists)', outfile_path)
            return
    
        # Determine if file is binary or text
        if is_binary(infile):
            # Copy binary file without rendering
            shutil.copy2(infile, outfile_path)
        else:
            # Render text file
            try:
                with open(infile) as f:
                    tmpl = env.from_string(f.read())
>               rendered_file = tmpl.render(**context)

cookiecutter/generate.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e03a60>
source = None

    def handle_exception(self, source: t.Optional[str] = None) -> "te.NoReturn":
        """Exception handling helper.  This is used internally to either raise
        rewritten exceptions or return a rendered traceback for the template.
        """
        from .debug import rewrite_traceback_stack
    
>       raise rewrite_traceback_stack(source=source)
E       jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'

/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: UndefinedError

During handling of the above exception, another exception occurred:

output_dir = '/tmp/pytest-of-openhands/pytest-30/test_raise_undefined_variable_2/output'
undefined_context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}

    def test_raise_undefined_variable_file_content(output_dir, undefined_context):
        """Verify correct error raised when file content cannot be rendered."""
        with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
>           generate.generate_files(
                repo_dir='tests/undefined-variable/file-content/',
                output_dir=output_dir,
                context=undefined_context,
            )

tests/test_generate_files.py:352: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:268: in generate_files
    generate_file(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

project_dir = '/tmp/pytest-of-openhands/pytest-30/test_raise_undefined_variable_2/output/testproject'
infile = 'README.rst'
context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}
env = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e03a60>
skip_if_file_exists = False

    def generate_file(project_dir, infile, context, env, skip_if_file_exists=False):
        """Render filename of infile as name of outfile, handle infile correctly.
    
        Dealing with infile appropriately:
    
            a. If infile is a binary file, copy it over without rendering.
            b. If infile is a text file, render its contents and write the
               rendered infile to outfile.
    
        Precondition:
    
            When calling `generate_file()`, the root template dir must be the
            current working directory. Using `utils.work_in()` is the recommended
            way to perform this directory change.
    
        :param project_dir: Absolute path to the resulting generated project.
        :param infile: Input file to generate the file from. Relative to the root
            template dir.
        :param context: Dict for populating the cookiecutter's variables.
        :param env: Jinja2 template execution environment.
        """
        infile_path = Path(infile)
    
        # Render the output file path
        outfile_tmpl = env.from_string(infile)
        outfile = outfile_tmpl.render(**context)
        outfile_path = Path(project_dir) / outfile
    
        # Create output directory if it doesn't exist
        make_sure_path_exists(outfile_path.parent)
    
        # Check if file exists and skip_if_file_exists is True
        if skip_if_file_exists and outfile_path.exists():
            logger.debug('Skipping file %s (already exists)', outfile_path)
            return
    
        # Determine if file is binary or text
        if is_binary(infile):
            # Copy binary file without rendering
            shutil.copy2(infile, outfile_path)
        else:
            # Render text file
            try:
                with open(infile) as f:
                    tmpl = env.from_string(f.read())
                rendered_file = tmpl.render(**context)
                with open(outfile_path, 'w') as f:
                    f.write(rendered_file)
            except UndefinedError as e:
>               raise UndefinedVariableInTemplate(f"Undefined variable in template: {e}") from e
E               TypeError: UndefinedVariableInTemplate.__init__() missing 2 required positional arguments: 'error' and 'context'

cookiecutter/generate.py:161: TypeError
____________________ test_raise_undefined_variable_dir_name ____________________

output_dir = '/tmp/pytest-of-openhands/pytest-30/test_raise_undefined_variable_3/output'
undefined_context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}

    def test_raise_undefined_variable_dir_name(output_dir, undefined_context):
        """Verify correct error raised when directory name cannot be rendered."""
        with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
>           generate.generate_files(
                repo_dir='tests/undefined-variable/dir-name/',
                output_dir=output_dir,
                context=undefined_context,
            )

tests/test_generate_files.py:367: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:244: in generate_files
    rendered_root = name_tmpl.render(**context)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'

<template>:1: UndefinedError
_______________________ test_keep_project_dir_on_failure _______________________

output_dir = '/tmp/pytest-of-openhands/pytest-30/test_keep_project_dir_on_failu0/output'
undefined_context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}

    def test_keep_project_dir_on_failure(output_dir, undefined_context):
        """Verify correct error raised when directory name cannot be rendered."""
        with pytest.raises(exceptions.UndefinedVariableInTemplate):
>           generate.generate_files(
                repo_dir='tests/undefined-variable/dir-name/',
                output_dir=output_dir,
                context=undefined_context,
                keep_project_on_failure=True,
            )

tests/test_generate_files.py:386: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:244: in generate_files
    rendered_root = name_tmpl.render(**context)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'

<template>:1: UndefinedError
___________ test_raise_undefined_variable_dir_name_existing_project ____________

output_dir = '/tmp/pytest-of-openhands/pytest-30/test_raise_undefined_variable_4/output'
undefined_context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}

    def test_raise_undefined_variable_dir_name_existing_project(
        output_dir, undefined_context
    ):
        """Verify correct error raised when directory name cannot be rendered."""
        testproj_path = Path(output_dir, 'testproject')
        testproj_path.mkdir()
    
        with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
>           generate.generate_files(
                repo_dir='tests/undefined-variable/dir-name/',
                output_dir=output_dir,
                context=undefined_context,
                overwrite_if_exists=True,
            )

tests/test_generate_files.py:403: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:244: in generate_files
    rendered_root = name_tmpl.render(**context)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'

<template>:1: UndefinedError
__________________ test_raise_undefined_variable_project_dir ___________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_raise_undefined_variable_5')

    def test_raise_undefined_variable_project_dir(tmp_path):
        """Verify correct error raised when directory name cannot be rendered."""
        with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
>           generate.generate_files(
                repo_dir='tests/undefined-variable/dir-name/',
                output_dir=tmp_path,
                context={},
            )

tests/test_generate_files.py:423: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:218: in generate_files
    project_dir = render_and_create_dir(
cookiecutter/generate.py:167: in render_and_create_dir
    rendered_name = name_tmpl.render(**context)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
<template>:1: in top-level template code
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <cookiecutter.environment.StrictEnvironment object at 0x7c8ac1e3d990>
obj = Undefined, attribute = 'project_slug'

    def getattr(self, obj: t.Any, attribute: str) -> t.Any:
        """Get an item or attribute of an object but prefer the attribute.
        Unlike :meth:`getitem` the attribute *must* be a string.
        """
        try:
>           return getattr(obj, attribute)
E           jinja2.exceptions.UndefinedError: 'cookiecutter' is undefined

/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:490: UndefinedError
____________________________ test_ignore_hooks_dirs ____________________________

    @pytest.mark.usefixtures('clean_system', 'remove_additional_folders')
    def test_ignore_hooks_dirs():
        """Verify hooks directory not created in target location on files generation."""
>       generate.generate_files(
            context={'cookiecutter': {'pyhooks': 'pyhooks'}},
            repo_dir='tests/test-pyhooks/',
            output_dir='tests/test-pyhooks/',
        )

tests/test_generate_hooks.py:35: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:228: in generate_files
    _run_hook_from_repo_dir(
cookiecutter/generate.py:192: in _run_hook_from_repo_dir
    run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context, delete_project_on_failure)
cookiecutter/hooks.py:141: in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
cookiecutter/hooks.py:84: in run_script_with_context
    with tempfile.NamedTemporaryFile(
/usr/lib/python3.10/tempfile.py:714: in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
/usr/lib/python3.10/tempfile.py:711: in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = '/workspace/cookiecutter/tests/test-pyhooks/tests/test-pyhooks/inputpyhooks'
pre = 'tmp', suf = '.py', flags = 131266, output_type = <class 'str'>

    def _mkstemp_inner(dir, pre, suf, flags, output_type):
        """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile."""
    
        dir = _os.path.abspath(dir)
        names = _get_candidate_names()
        if output_type is bytes:
            names = map(_os.fsencode, names)
    
        for seq in range(TMP_MAX):
            name = next(names)
            file = _os.path.join(dir, pre + name + suf)
            _sys.audit("tempfile.mkstemp", file)
            try:
>               fd = _os.open(file, flags, 0o600)
E               FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-pyhooks/tests/test-pyhooks/inputpyhooks/tmpy8xnvf58.py'

/usr/lib/python3.10/tempfile.py:395: FileNotFoundError
____________________________ test_run_python_hooks _____________________________

    @pytest.mark.usefixtures('clean_system', 'remove_additional_folders')
    def test_run_python_hooks():
        """Verify pre and post generation python hooks executed and result in output_dir.
    
        Each hook should create in target directory. Test verifies that these files
        created.
        """
>       generate.generate_files(
            context={'cookiecutter': {'pyhooks': 'pyhooks'}},
            repo_dir='tests/test-pyhooks/',
            output_dir='tests/test-pyhooks/',
        )

tests/test_generate_hooks.py:50: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:228: in generate_files
    _run_hook_from_repo_dir(
cookiecutter/generate.py:192: in _run_hook_from_repo_dir
    run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context, delete_project_on_failure)
cookiecutter/hooks.py:141: in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
cookiecutter/hooks.py:84: in run_script_with_context
    with tempfile.NamedTemporaryFile(
/usr/lib/python3.10/tempfile.py:714: in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
/usr/lib/python3.10/tempfile.py:711: in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = '/workspace/cookiecutter/tests/test-pyhooks/tests/test-pyhooks/inputpyhooks'
pre = 'tmp', suf = '.py', flags = 131266, output_type = <class 'str'>

    def _mkstemp_inner(dir, pre, suf, flags, output_type):
        """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile."""
    
        dir = _os.path.abspath(dir)
        names = _get_candidate_names()
        if output_type is bytes:
            names = map(_os.fsencode, names)
    
        for seq in range(TMP_MAX):
            name = next(names)
            file = _os.path.join(dir, pre + name + suf)
            _sys.audit("tempfile.mkstemp", file)
            try:
>               fd = _os.open(file, flags, 0o600)
E               FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-pyhooks/tests/test-pyhooks/inputpyhooks/tmpq4xplwjd.py'

/usr/lib/python3.10/tempfile.py:395: FileNotFoundError
__________________________ test_run_python_hooks_cwd ___________________________

    @pytest.mark.usefixtures('clean_system', 'remove_additional_folders')
    def test_run_python_hooks_cwd():
        """Verify pre and post generation python hooks executed and result in current dir.
    
        Each hook should create in target directory. Test verifies that these files
        created.
        """
>       generate.generate_files(
            context={'cookiecutter': {'pyhooks': 'pyhooks'}}, repo_dir='tests/test-pyhooks/'
        )

tests/test_generate_hooks.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:228: in generate_files
    _run_hook_from_repo_dir(
cookiecutter/generate.py:192: in _run_hook_from_repo_dir
    run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context, delete_project_on_failure)
cookiecutter/hooks.py:141: in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
cookiecutter/hooks.py:84: in run_script_with_context
    with tempfile.NamedTemporaryFile(
/usr/lib/python3.10/tempfile.py:714: in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
/usr/lib/python3.10/tempfile.py:711: in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = '/workspace/cookiecutter/tests/test-pyhooks/inputpyhooks', pre = 'tmp'
suf = '.py', flags = 131266, output_type = <class 'str'>

    def _mkstemp_inner(dir, pre, suf, flags, output_type):
        """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile."""
    
        dir = _os.path.abspath(dir)
        names = _get_candidate_names()
        if output_type is bytes:
            names = map(_os.fsencode, names)
    
        for seq in range(TMP_MAX):
            name = next(names)
            file = _os.path.join(dir, pre + name + suf)
            _sys.audit("tempfile.mkstemp", file)
            try:
>               fd = _os.open(file, flags, 0o600)
E               FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-pyhooks/inputpyhooks/tmpqu5l01fi.py'

/usr/lib/python3.10/tempfile.py:395: FileNotFoundError
_______________________________ test_empty_hooks _______________________________

    @pytest.mark.skipif(WINDOWS, reason='OSError.errno=8 is not thrown on Windows')
    @pytest.mark.usefixtures('clean_system', 'remove_additional_folders')
    def test_empty_hooks():
        """Verify error is raised on empty hook script. Ignored on windows.
    
        OSError.errno=8 is not thrown on Windows when the script is empty
        because it always runs through shell instead of needing a shebang.
        """
        with pytest.raises(FailedHookException) as excinfo:
>           generate.generate_files(
                context={'cookiecutter': {'shellhooks': 'shellhooks'}},
                repo_dir='tests/test-shellhooks-empty/',
                overwrite_if_exists=True,
            )

tests/test_generate_hooks.py:82: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:228: in generate_files
    _run_hook_from_repo_dir(
cookiecutter/generate.py:192: in _run_hook_from_repo_dir
    run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context, delete_project_on_failure)
cookiecutter/hooks.py:141: in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
cookiecutter/hooks.py:84: in run_script_with_context
    with tempfile.NamedTemporaryFile(
/usr/lib/python3.10/tempfile.py:714: in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
/usr/lib/python3.10/tempfile.py:711: in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = '/workspace/cookiecutter/tests/test-shellhooks-empty/inputshellhooks'
pre = 'tmp', suf = '.sh', flags = 131266, output_type = <class 'str'>

    def _mkstemp_inner(dir, pre, suf, flags, output_type):
        """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile."""
    
        dir = _os.path.abspath(dir)
        names = _get_candidate_names()
        if output_type is bytes:
            names = map(_os.fsencode, names)
    
        for seq in range(TMP_MAX):
            name = next(names)
            file = _os.path.join(dir, pre + name + suf)
            _sys.audit("tempfile.mkstemp", file)
            try:
>               fd = _os.open(file, flags, 0o600)
E               FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-shellhooks-empty/inputshellhooks/tmpcneofrpt.sh'

/usr/lib/python3.10/tempfile.py:395: FileNotFoundError
______________________________ test_oserror_hooks ______________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1df6440>

    @pytest.mark.usefixtures('clean_system', 'remove_additional_folders')
    def test_oserror_hooks(mocker):
        """Verify script error passed correctly to cookiecutter error.
    
        Here subprocess.Popen function mocked, ie we do not call hook script,
        just produce expected error.
        """
        message = 'Out of memory'
    
        err = OSError(message)
        err.errno = errno.ENOMEM
    
        prompt = mocker.patch('subprocess.Popen')
        prompt.side_effect = err
    
        with pytest.raises(FailedHookException) as excinfo:
>           generate.generate_files(
                context={'cookiecutter': {'shellhooks': 'shellhooks'}},
                repo_dir='tests/test-shellhooks-empty/',
                overwrite_if_exists=True,
            )

tests/test_generate_hooks.py:106: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:228: in generate_files
    _run_hook_from_repo_dir(
cookiecutter/generate.py:192: in _run_hook_from_repo_dir
    run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context, delete_project_on_failure)
cookiecutter/hooks.py:141: in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
cookiecutter/hooks.py:84: in run_script_with_context
    with tempfile.NamedTemporaryFile(
/usr/lib/python3.10/tempfile.py:714: in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
/usr/lib/python3.10/tempfile.py:711: in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = '/workspace/cookiecutter/tests/test-shellhooks-empty/inputshellhooks'
pre = 'tmp', suf = '.sh', flags = 131266, output_type = <class 'str'>

    def _mkstemp_inner(dir, pre, suf, flags, output_type):
        """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile."""
    
        dir = _os.path.abspath(dir)
        names = _get_candidate_names()
        if output_type is bytes:
            names = map(_os.fsencode, names)
    
        for seq in range(TMP_MAX):
            name = next(names)
            file = _os.path.join(dir, pre + name + suf)
            _sys.audit("tempfile.mkstemp", file)
            try:
>               fd = _os.open(file, flags, 0o600)
E               FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-shellhooks-empty/inputshellhooks/tmp7ybcmt71.sh'

/usr/lib/python3.10/tempfile.py:395: FileNotFoundError
________________ test_run_failing_hook_removes_output_directory ________________

    @pytest.mark.usefixtures('clean_system', 'remove_additional_folders')
    def test_run_failing_hook_removes_output_directory():
        """Verify project directory not created or removed if hook failed."""
        repo_path = os.path.abspath('tests/test-hooks/')
        hooks_path = os.path.abspath('tests/test-hooks/hooks')
    
        hook_dir = os.path.join(repo_path, 'hooks')
        template = os.path.join(repo_path, 'input{{cookiecutter.hooks}}')
        os.mkdir(repo_path)
        os.mkdir(hook_dir)
        os.mkdir(template)
    
        hook_path = os.path.join(hooks_path, 'pre_gen_project.py')
    
        with Path(hook_path).open('w') as f:
            f.write("#!/usr/bin/env python\n")
            f.write("import sys; sys.exit(1)\n")
    
        with pytest.raises(FailedHookException) as excinfo:
>           generate.generate_files(
                context={'cookiecutter': {'hooks': 'hooks'}},
                repo_dir='tests/test-hooks/',
                overwrite_if_exists=True,
            )

tests/test_generate_hooks.py:133: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:228: in generate_files
    _run_hook_from_repo_dir(
cookiecutter/generate.py:192: in _run_hook_from_repo_dir
    run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context, delete_project_on_failure)
cookiecutter/hooks.py:141: in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
cookiecutter/hooks.py:84: in run_script_with_context
    with tempfile.NamedTemporaryFile(
/usr/lib/python3.10/tempfile.py:714: in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
/usr/lib/python3.10/tempfile.py:711: in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = '/workspace/cookiecutter/tests/test-hooks/inputhooks', pre = 'tmp'
suf = '.py', flags = 131266, output_type = <class 'str'>

    def _mkstemp_inner(dir, pre, suf, flags, output_type):
        """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile."""
    
        dir = _os.path.abspath(dir)
        names = _get_candidate_names()
        if output_type is bytes:
            names = map(_os.fsencode, names)
    
        for seq in range(TMP_MAX):
            name = next(names)
            file = _os.path.join(dir, pre + name + suf)
            _sys.audit("tempfile.mkstemp", file)
            try:
>               fd = _os.open(file, flags, 0o600)
E               FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-hooks/inputhooks/tmpip2eeah7.py'

/usr/lib/python3.10/tempfile.py:395: FileNotFoundError
__________ test_run_failing_hook_preserves_existing_output_directory ___________

    @pytest.mark.usefixtures('clean_system', 'remove_additional_folders')
    def test_run_failing_hook_preserves_existing_output_directory():
        """Verify project directory not removed if exist before hook failed."""
        repo_path = os.path.abspath('tests/test-hooks/')
        hooks_path = os.path.abspath('tests/test-hooks/hooks')
    
        hook_dir = os.path.join(repo_path, 'hooks')
        template = os.path.join(repo_path, 'input{{cookiecutter.hooks}}')
        os.mkdir(repo_path)
        os.mkdir(hook_dir)
        os.mkdir(template)
    
        hook_path = os.path.join(hooks_path, 'pre_gen_project.py')
    
        with Path(hook_path).open('w') as f:
            f.write("#!/usr/bin/env python\n")
            f.write("import sys; sys.exit(1)\n")
    
        os.mkdir('inputhooks')
        with pytest.raises(FailedHookException) as excinfo:
>           generate.generate_files(
                context={'cookiecutter': {'hooks': 'hooks'}},
                repo_dir='tests/test-hooks/',
                overwrite_if_exists=True,
            )

tests/test_generate_hooks.py:163: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:228: in generate_files
    _run_hook_from_repo_dir(
cookiecutter/generate.py:192: in _run_hook_from_repo_dir
    run_hook_from_repo_dir(repo_dir, hook_name, project_dir, context, delete_project_on_failure)
cookiecutter/hooks.py:141: in run_hook_from_repo_dir
    run_hook(hook_name, project_dir, context)
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
cookiecutter/hooks.py:84: in run_script_with_context
    with tempfile.NamedTemporaryFile(
/usr/lib/python3.10/tempfile.py:714: in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
/usr/lib/python3.10/tempfile.py:711: in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

dir = '/workspace/cookiecutter/tests/test-hooks/inputhooks', pre = 'tmp'
suf = '.py', flags = 131266, output_type = <class 'str'>

    def _mkstemp_inner(dir, pre, suf, flags, output_type):
        """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile."""
    
        dir = _os.path.abspath(dir)
        names = _get_candidate_names()
        if output_type is bytes:
            names = map(_os.fsencode, names)
    
        for seq in range(TMP_MAX):
            name = next(names)
            file = _os.path.join(dir, pre + name + suf)
            _sys.audit("tempfile.mkstemp", file)
            try:
>               fd = _os.open(file, flags, 0o600)
E               FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-hooks/inputhooks/tmpethnonol.py'

/usr/lib/python3.10/tempfile.py:395: FileNotFoundError
____________________ test_deprecate_run_hook_from_repo_dir _____________________

tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_deprecate_run_hook_from_r0')

    @pytest.mark.usefixtures("clean_system", "remove_additional_folders")
    def test_deprecate_run_hook_from_repo_dir(tmp_path):
        """Test deprecation warning in generate._run_hook_from_repo_dir."""
        repo_dir = "tests/test-shellhooks/"
        project_dir = Path(tmp_path.joinpath('test-shellhooks'))
        project_dir.mkdir()
>       with pytest.deprecated_call():
E       Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>, <class 'PendingDeprecationWarning'>, <class 'FutureWarning'>) were emitted.
E        Emitted warnings: [].

tests/test_generate_hooks.py:240: Failed
___________________________ test_info_stdout_logging ___________________________

caplog = <_pytest.logging.LogCaptureFixture object at 0x7c8ac16c9120>
info_logger = None
info_messages = ['INFO: Welcome to Cookiecutter', 'INFO: Loading user config from home dir', 'ERROR: Aw, snap! Something went wrong']

    def test_info_stdout_logging(caplog, info_logger, info_messages):
        """Test that stdout logs use info format and level."""
>       [stream_handler] = info_logger.handlers
E       AttributeError: 'NoneType' object has no attribute 'handlers'

tests/test_log.py:75: AttributeError
__________________________ test_debug_stdout_logging ___________________________

caplog = <_pytest.logging.LogCaptureFixture object at 0x7c8ac16bed40>
debug_logger = None
debug_messages = ['INFO cookiecutter: Welcome to Cookiecutter', 'DEBUG cookiecutter: Generating project from pytest-plugin', 'INFO cookiecutter.foo: Loading user config from home dir', "DEBUG cookiecutter.foo.bar: I don't know.", 'DEBUG cookiecutter.foo.bar: I wanted to save the world.', 'ERROR cookiecutter.foo: Aw, snap! Something went wrong', ...]

    def test_debug_stdout_logging(caplog, debug_logger, debug_messages):
        """Test that stdout logs use debug format and level."""
>       [stream_handler] = debug_logger.handlers
E       AttributeError: 'NoneType' object has no attribute 'handlers'

tests/test_log.py:92: AttributeError
___________________________ test_debug_file_logging ____________________________

caplog = <_pytest.logging.LogCaptureFixture object at 0x7c8ac16cb190>
info_logger_with_file = None
debug_file = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_debug_file_logging0/pytest-plugin.log')
debug_messages = ['INFO cookiecutter: Welcome to Cookiecutter', 'DEBUG cookiecutter: Generating project from pytest-plugin', 'INFO cookiecutter.foo: Loading user config from home dir', "DEBUG cookiecutter.foo.bar: I don't know.", 'DEBUG cookiecutter.foo.bar: I wanted to save the world.', 'ERROR cookiecutter.foo: Aw, snap! Something went wrong', ...]

    def test_debug_file_logging(caplog, info_logger_with_file, debug_file, debug_messages):
        """Test that logging to stdout uses a different format and level than \
        the the file handler."""
>       [file_handler, stream_handler] = info_logger_with_file.handlers
E       AttributeError: 'NoneType' object has no attribute 'handlers'

tests/test_log.py:110: AttributeError
________________________ test_replay_dump_template_name ________________________

self = <MagicMock name='dump' id='136935394268864'>
args = ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
kwargs = {}
expected = call('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
actual = call('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '', OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))]))
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7c8ac1529ea0>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: dump('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
E           Actual: dump('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '', OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))]))

/usr/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

self = <MagicMock name='dump' id='136935394268864'>
args = ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
kwargs = {}

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
>       return self.assert_called_with(*args, **kwargs)
E       AssertionError: expected call not found.
E       Expected: dump('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
E       Actual: dump('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '', OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))]))
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '', OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))])) == ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
E         
E         At index 1 diff: '' != 'fake-repo-tmpl'
E         
E         Full diff:
E           (
E               '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay',
E         -     'fake-repo-tmpl',
E         -     <ANY>,
E         +     '',
E         +     OrderedDict({
E         +         '_cookiecutter': OrderedDict({
E         +             'email': 'audreyr@gmail.com',
E         +             'full_name': 'Audrey Roy',
E         +             'github_username': 'audreyr',
E         +             'project_name': 'Fake Project Templated',
E         +             'project_short_description': 'This is a fake project.',
E         +             'release_date': '2013-07-28',
E         +             'repo_name': "{{ cookiecutter.project_name|lower|replace(' ', '-') }}",
E         +             'version': '0.1',
E         +             'year': '2013',
E         +         }),
E         +         'cookiecutter': OrderedDict({
E         +             'email': 'audreyr@gmail.com',
E         +             'full_name': 'Audrey Roy',
E         +             'github_username': 'audreyr',
E         +             'project_name': 'Fake Project Templated',
E         +             'project_short_description': 'This is a fake project.',
E         +             'release_date': '2013-07-28',
E         +             'repo_name': "{{ cookiecutter.project_name|lower|replace(' ', '-') }}",
E         +             'version': '0.1',
E         +             'year': '2013',
E         +         }),
E         +     }),
E           )

/usr/lib/python3.10/unittest/mock.py:941: AssertionError

During handling of the above exception, another exception occurred:

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac1886740>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1886830>
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay'}
user_config_file = '/tmp/pytest-of-openhands/pytest-30/user_dir0/config'

    def test_replay_dump_template_name(
        monkeypatch, mocker, user_config_data, user_config_file
    ):
        """Check that replay_dump is called with a valid template_name.
    
        Template name must not be a relative path.
    
        Otherwise files such as ``..json`` are created, which are not just cryptic
        but also later mistaken for replay files of other templates if invoked with
        '.' and '--replay'.
    
        Change the current working directory temporarily to 'tests/fake-repo-tmpl'
        for this test and call cookiecutter with '.' for the target template.
        """
        monkeypatch.chdir('tests/fake-repo-tmpl')
    
        mock_replay_dump = mocker.patch('cookiecutter.main.dump')
        mocker.patch('cookiecutter.main.generate_files')
    
        cookiecutter(
            '.',
            no_input=True,
            replay=False,
            config_file=user_config_file,
        )
    
>       mock_replay_dump.assert_called_once_with(
            user_config_data['replay_dir'],
            'fake-repo-tmpl',
            mocker.ANY,
        )
E       AssertionError: expected call not found.
E       Expected: dump('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
E       Actual: dump('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '', OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))]))
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '', OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))])) == ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
E         
E         At index 1 diff: '' != 'fake-repo-tmpl'
E         
E         Full diff:
E           (
E               '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay',
E         -     'fake-repo-tmpl',
E         -     <ANY>,
E         +     '',
E         +     OrderedDict({
E         +         '_cookiecutter': OrderedDict({
E         +             'email': 'audreyr@gmail.com',
E         +             'full_name': 'Audrey Roy',
E         +             'github_username': 'audreyr',
E         +             'project_name': 'Fake Project Templated',
E         +             'project_short_description': 'This is a fake project.',
E         +             'release_date': '2013-07-28',
E         +             'repo_name': "{{ cookiecutter.project_name|lower|replace(' ', '-') }}",
E         +             'version': '0.1',
E         +             'year': '2013',
E         +         }),
E         +         'cookiecutter': OrderedDict({
E         +             'email': 'audreyr@gmail.com',
E         +             'full_name': 'Audrey Roy',
E         +             'github_username': 'audreyr',
E         +             'project_name': 'Fake Project Templated',
E         +             'project_short_description': 'This is a fake project.',
E         +             'release_date': '2013-07-28',
E         +             'repo_name': "{{ cookiecutter.project_name|lower|replace(' ', '-') }}",
E         +             'version': '0.1',
E         +             'year': '2013',
E         +         }),
E         +     }),
E           )

/workspace/cookiecutter/tests/test_main.py:58: AssertionError
________________________ test_replay_load_template_name ________________________

self = <MagicMock name='load' id='136935400017824'>
args = ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
kwargs = {}
expected = call('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
actual = call('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '')
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7c8ac1529240>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: load('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
E           Actual: load('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '')

/usr/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

self = <MagicMock name='load' id='136935400017824'>
args = ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
kwargs = {}

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
>       return self.assert_called_with(*args, **kwargs)
E       AssertionError: expected call not found.
E       Expected: load('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
E       Actual: load('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '') == ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
E         
E         At index 1 diff: '' != 'fake-repo-tmpl'
E         
E         Full diff:
E           (
E               '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay',
E         -     'fake-repo-tmpl',
E         +     '',
E           )

/usr/lib/python3.10/unittest/mock.py:941: AssertionError

During handling of the above exception, another exception occurred:

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac1e00460>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e029e0>
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay'}
user_config_file = '/tmp/pytest-of-openhands/pytest-30/user_dir0/config'

    def test_replay_load_template_name(
        monkeypatch, mocker, user_config_data, user_config_file
    ):
        """Check that replay_load is called correctly.
    
        Calls require valid template_name that is not a relative path.
    
        Change the current working directory temporarily to 'tests/fake-repo-tmpl'
        for this test and call cookiecutter with '.' for the target template.
        """
        monkeypatch.chdir('tests/fake-repo-tmpl')
    
        mock_replay_load = mocker.patch('cookiecutter.main.load')
        mocker.patch('cookiecutter.main.generate_context').return_value = {
            'cookiecutter': {}
        }
        mocker.patch('cookiecutter.main.generate_files')
        mocker.patch('cookiecutter.main.dump')
    
        cookiecutter(
            '.',
            replay=True,
            config_file=user_config_file,
        )
    
>       mock_replay_load.assert_called_once_with(
            user_config_data['replay_dir'],
            'fake-repo-tmpl',
        )
E       AssertionError: expected call not found.
E       Expected: load('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
E       Actual: load('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '') == ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
E         
E         At index 1 diff: '' != 'fake-repo-tmpl'
E         
E         Full diff:
E           (
E               '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay',
E         -     'fake-repo-tmpl',
E         +     '',
E           )

/workspace/cookiecutter/tests/test_main.py:90: AssertionError
___________________________ test_custom_replay_file ____________________________

self = <MagicMock name='load' id='136935393469168'>
args = ('.', 'custom-replay-file'), kwargs = {}
expected = call('.', 'custom-replay-file')
actual = call('.', './custom-replay-file')
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7c8ac1795000>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: load('.', 'custom-replay-file')
E           Actual: load('.', './custom-replay-file')

/usr/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

self = <MagicMock name='load' id='136935393469168'>
args = ('.', 'custom-replay-file'), kwargs = {}

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
>       return self.assert_called_with(*args, **kwargs)
E       AssertionError: expected call not found.
E       Expected: load('.', 'custom-replay-file')
E       Actual: load('.', './custom-replay-file')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('.', './custom-replay-file') == ('.', 'custom-replay-file')
E         
E         At index 1 diff: './custom-replay-file' != 'custom-replay-file'
E         
E         Full diff:
E           (
E               '.',
E         -     'custom-replay-file',
E         +     './custom-replay-file',
E         ?      ++
E           )

/usr/lib/python3.10/unittest/mock.py:941: AssertionError

During handling of the above exception, another exception occurred:

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac17c1060>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac17c1150>
user_config_file = '/tmp/pytest-of-openhands/pytest-30/user_dir0/config'

    def test_custom_replay_file(monkeypatch, mocker, user_config_file):
        """Check that reply.load is called with the custom replay_file."""
        monkeypatch.chdir('tests/fake-repo-tmpl')
    
        mock_replay_load = mocker.patch('cookiecutter.main.load')
        mocker.patch('cookiecutter.main.generate_context').return_value = {
            'cookiecutter': {}
        }
        mocker.patch('cookiecutter.main.generate_files')
        mocker.patch('cookiecutter.main.dump')
    
        cookiecutter(
            '.',
            replay='./custom-replay-file',
            config_file=user_config_file,
        )
    
>       mock_replay_load.assert_called_once_with(
            '.',
            'custom-replay-file',
        )
E       AssertionError: expected call not found.
E       Expected: load('.', 'custom-replay-file')
E       Actual: load('.', './custom-replay-file')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('.', './custom-replay-file') == ('.', 'custom-replay-file')
E         
E         At index 1 diff: './custom-replay-file' != 'custom-replay-file'
E         
E         Full diff:
E           (
E               '.',
E         -     'custom-replay-file',
E         +     './custom-replay-file',
E         ?      ++
E           )

/workspace/cookiecutter/tests/test_main.py:113: AssertionError
______________________________ test_output_folder ______________________________

    @pytest.mark.usefixtures('clean_system', 'remove_output_folder')
    def test_output_folder():
        """Tests should correctly create content, as output_folder does not yet exist."""
        context = generate.generate_context(
            context_file='tests/test-output-folder/cookiecutter.json'
        )
        generate.generate_files(context=context, repo_dir='tests/test-output-folder')
    
        something = """Hi!
    My name is Audrey Greenfeld.
    It is 2014.
    """
>       something2 = Path('output_folder/something.txt').read_text()

tests/test_output_folder.py:36: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:1134: in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = PosixPath('output_folder/something.txt'), mode = 'r', buffering = -1
encoding = 'locale', errors = None, newline = None

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if "b" not in mode:
            encoding = io.text_encoding(encoding)
>       return self._accessor.open(self, mode, buffering, encoding, errors,
                                   newline)
E       FileNotFoundError: [Errno 2] No such file or directory: 'output_folder/something.txt'

/usr/lib/python3.10/pathlib.py:1119: FileNotFoundError
_______________________ test_run_pre_prompt_python_hook ________________________

script_path = PosixPath('/tmp/tmpa3l0yksj/hooks/pre_prompt.py'), cwd = '.'
context = {}

    def run_script_with_context(script_path, cwd, context):
        """Execute a script after rendering it with Jinja.
    
        :param script_path: Absolute path to the script to run.
        :param cwd: The directory to run the script from.
        :param context: Cookiecutter project template context.
        """
        script_path = Path(script_path)
    
        if context:
            env = create_env_with_context(context)
            template = env.from_string(script_path.read_text())
            rendered_script = template.render(**context)
        else:
            rendered_script = script_path.read_text()
    
        with tempfile.NamedTemporaryFile(
            mode='w', suffix=script_path.suffix, delete=False, dir=cwd
        ) as temp_script:
            temp_script.write(rendered_script)
            temp_script_path = Path(temp_script.name)
    
        utils.make_executable(temp_script_path)
    
        try:
>           proc = subprocess.Popen(
                [str(temp_script_path)],
                cwd=cwd,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
            )

cookiecutter/hooks.py:93: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/subprocess.py:971: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Popen: returncode: 255 args: ['/tmp/tmpa3l0yksj/tmp89vayrp5.py']>
args = ['/tmp/tmpa3l0yksj/tmp89vayrp5.py']
executable = b'/tmp/tmpa3l0yksj/tmp89vayrp5.py', preexec_fn = None
close_fds = True, pass_fds = (), cwd = '.', env = None, startupinfo = None
creationflags = 0, shell = False, p2cread = -1, p2cwrite = -1, c2pread = 11
c2pwrite = 12, errread = 13, errwrite = 14, restore_signals = True, gid = None
gids = None, uid = None, umask = -1, start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       restore_signals,
                       gid, gids, uid, umask,
                       start_new_session):
        """Execute program (POSIX version)"""
    
        if isinstance(args, (str, bytes)):
            args = [args]
        elif isinstance(args, os.PathLike):
            if shell:
                raise TypeError('path-like args is not allowed when '
                                'shell is true')
            args = [args]
        else:
            args = list(args)
    
        if shell:
            # On Android the default shell is at '/system/bin/sh'.
            unix_shell = ('/system/bin/sh' if
                      hasattr(sys, 'getandroidapilevel') else '/bin/sh')
            args = [unix_shell, "-c"] + args
            if executable:
                args[0] = executable
    
        if executable is None:
            executable = args[0]
    
        sys.audit("subprocess.Popen", executable, args, cwd, env)
    
        if (_USE_POSIX_SPAWN
                and os.path.dirname(executable)
                and preexec_fn is None
                and not close_fds
                and not pass_fds
                and cwd is None
                and (p2cread == -1 or p2cread > 2)
                and (c2pwrite == -1 or c2pwrite > 2)
                and (errwrite == -1 or errwrite > 2)
                and not start_new_session
                and gid is None
                and gids is None
                and uid is None
                and umask < 0):
            self._posix_spawn(args, executable, env, restore_signals,
                              p2cread, p2cwrite,
                              c2pread, c2pwrite,
                              errread, errwrite)
            return
    
        orig_executable = executable
    
        # For transferring possible exec failure from child to parent.
        # Data format: "exception name:hex errno:description"
        # Pickle is not used; it is complex and involves memory allocation.
        errpipe_read, errpipe_write = os.pipe()
        # errpipe_write must not be in the standard io 0, 1, or 2 fd range.
        low_fds_to_close = []
        while errpipe_write < 3:
            low_fds_to_close.append(errpipe_write)
            errpipe_write = os.dup(errpipe_write)
        for low_fd in low_fds_to_close:
            os.close(low_fd)
        try:
            try:
                # We must avoid complex work that could involve
                # malloc or free in the child process to avoid
                # potential deadlocks, thus we do all this here.
                # and pass it to fork_exec()
    
                if env is not None:
                    env_list = []
                    for k, v in env.items():
                        k = os.fsencode(k)
                        if b'=' in k:
                            raise ValueError("illegal environment variable name")
                        env_list.append(k + b'=' + os.fsencode(v))
                else:
                    env_list = None  # Use execv instead of execve.
                executable = os.fsencode(executable)
                if os.path.dirname(executable):
                    executable_list = (executable,)
                else:
                    # This matches the behavior of os._execvpe().
                    executable_list = tuple(
                        os.path.join(os.fsencode(dir), executable)
                        for dir in os.get_exec_path(env))
                fds_to_keep = set(pass_fds)
                fds_to_keep.add(errpipe_write)
                self.pid = _posixsubprocess.fork_exec(
                        args, executable_list,
                        close_fds, tuple(sorted(map(int, fds_to_keep))),
                        cwd, env_list,
                        p2cread, p2cwrite, c2pread, c2pwrite,
                        errread, errwrite,
                        errpipe_read, errpipe_write,
                        restore_signals, start_new_session,
                        gid, gids, uid, umask,
                        preexec_fn)
                self._child_created = True
            finally:
                # be sure the FD is closed no matter what
                os.close(errpipe_write)
    
            self._close_pipe_fds(p2cread, p2cwrite,
                                 c2pread, c2pwrite,
                                 errread, errwrite)
    
            # Wait for exec to fail or succeed; possibly raising an
            # exception (limited in size)
            errpipe_data = bytearray()
            while True:
                part = os.read(errpipe_read, 50000)
                errpipe_data += part
                if not part or len(errpipe_data) > 50000:
                    break
        finally:
            # be sure the FD is closed no matter what
            os.close(errpipe_read)
    
        if errpipe_data:
            try:
                pid, sts = os.waitpid(self.pid, 0)
                if pid == self.pid:
                    self._handle_exitstatus(sts)
                else:
                    self.returncode = sys.maxsize
            except ChildProcessError:
                pass
    
            try:
                exception_name, hex_errno, err_msg = (
                        errpipe_data.split(b':', 2))
                # The encoding here should match the encoding
                # written in by the subprocess implementations
                # like _posixsubprocess
                err_msg = err_msg.decode()
            except ValueError:
                exception_name = b'SubprocessError'
                hex_errno = b'0'
                err_msg = 'Bad exception data from child: {!r}'.format(
                              bytes(errpipe_data))
            child_exception_type = getattr(
                    builtins, exception_name.decode('ascii'),
                    SubprocessError)
            if issubclass(child_exception_type, OSError) and hex_errno:
                errno_num = int(hex_errno, 16)
                child_exec_never_called = (err_msg == "noexec")
                if child_exec_never_called:
                    err_msg = ""
                    # The error must be from chdir(cwd).
                    err_filename = cwd
                else:
                    err_filename = orig_executable
                if errno_num != 0:
                    err_msg = os.strerror(errno_num)
>               raise child_exception_type(errno_num, err_msg, err_filename)
E               OSError: [Errno 8] Exec format error: '/tmp/tmpa3l0yksj/tmp89vayrp5.py'

/usr/lib/python3.10/subprocess.py:1863: OSError

During handling of the above exception, another exception occurred:

remove_tmp_repo_dir = <function remove_tmp_repo_dir.<locals>._func at 0x7c8ac16bbbe0>

    def test_run_pre_prompt_python_hook(remove_tmp_repo_dir):
        """Verify pre_prompt.py runs and creates a copy of cookiecutter.json."""
>       new_repo_dir = hooks.run_pre_prompt_hook(repo_dir='tests/test-pyhooks/')

tests/test_pre_prompt_hooks.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/hooks.py:155: in run_pre_prompt_hook
    run_hook('pre_prompt', '.', {})
cookiecutter/hooks.py:127: in run_hook
    run_script_with_context(hook, project_dir, context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

script_path = PosixPath('/tmp/tmpa3l0yksj/hooks/pre_prompt.py'), cwd = '.'
context = {}

    def run_script_with_context(script_path, cwd, context):
        """Execute a script after rendering it with Jinja.
    
        :param script_path: Absolute path to the script to run.
        :param cwd: The directory to run the script from.
        :param context: Cookiecutter project template context.
        """
        script_path = Path(script_path)
    
        if context:
            env = create_env_with_context(context)
            template = env.from_string(script_path.read_text())
            rendered_script = template.render(**context)
        else:
            rendered_script = script_path.read_text()
    
        with tempfile.NamedTemporaryFile(
            mode='w', suffix=script_path.suffix, delete=False, dir=cwd
        ) as temp_script:
            temp_script.write(rendered_script)
            temp_script_path = Path(temp_script.name)
    
        utils.make_executable(temp_script_path)
    
        try:
            proc = subprocess.Popen(
                [str(temp_script_path)],
                cwd=cwd,
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
            )
            stdout, stderr = proc.communicate()
            if proc.returncode != EXIT_SUCCESS:
                raise FailedHookException(
                    f"Hook script failed (exit code: {proc.returncode})"
                )
        except OSError as err:
            if err.errno == errno.ENOEXEC:
>               raise FailedHookException(
                    'Hook script failed, might be an empty file or missing a shebang'
                )
E               cookiecutter.exceptions.FailedHookException: Hook script failed, might be an empty file or missing a shebang

cookiecutter/hooks.py:106: FailedHookException
_____________________ test_run_pre_prompt_python_hook_fail _____________________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac1dc25c0>

    def test_run_pre_prompt_python_hook_fail(monkeypatch):
        """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)
E       AssertionError: assert 'Pre-Prompt Hook script failed' in 'Hook script failed, might be an empty file or missing a shebang'
E        +  where 'Hook script failed, might be an empty file or missing a shebang' = str(FailedHookException('Hook script failed, might be an empty file or missing a shebang'))
E        +    where FailedHookException('Hook script failed, might be an empty file or missing a shebang') = <ExceptionInfo FailedHookException('Hook script failed, might be an empty file or missing a shebang') tblen=4>.value

tests/test_pre_prompt_hooks.py:41: AssertionError
_________________ TestRenderVariable.test_convert_to_str[1-1] __________________

self = <tests.test_prompt.TestRenderVariable object at 0x7c8ac1eefa60>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac17dea40>
raw_var = 1, rendered_var = '1'

    @pytest.mark.parametrize(
        'raw_var, rendered_var',
        [
            (1, '1'),
            (True, True),
            ('foo', 'foo'),
            ('{{cookiecutter.project}}', 'foobar'),
            (None, None),
        ],
    )
    def test_convert_to_str(self, mocker, raw_var, rendered_var):
        """Verify simple items correctly rendered to strings."""
        env = environment.StrictEnvironment()
        from_string = mocker.patch(
            'cookiecutter.utils.StrictEnvironment.from_string', wraps=env.from_string
        )
        context = {'project': 'foobar'}
    
        result = prompt.render_variable(env, raw_var, context)
>       assert result == rendered_var
E       AssertionError: assert 1 == '1'

tests/test_prompt.py:44: AssertionError
_ TestRenderVariable.test_convert_to_str_complex_variables[raw_var0-rendered_var0] _

self = <tests.test_prompt.TestRenderVariable object at 0x7c8ac1f24430>
raw_var = {1: True, 'foo': False}, rendered_var = {'1': True, 'foo': False}

    @pytest.mark.parametrize(
        'raw_var, rendered_var',
        [
            ({1: True, 'foo': False}, {'1': True, 'foo': False}),
            (
                {'{{cookiecutter.project}}': ['foo', 1], 'bar': False},
                {'foobar': ['foo', '1'], 'bar': False},
            ),
            (['foo', '{{cookiecutter.project}}', None], ['foo', 'foobar', None]),
        ],
    )
    def test_convert_to_str_complex_variables(self, raw_var, rendered_var):
        """Verify tree items correctly rendered."""
        env = environment.StrictEnvironment()
        context = {'project': 'foobar'}
    
        result = prompt.render_variable(env, raw_var, context)
>       assert result == rendered_var
E       AssertionError: assert {1: True, 'foo': False} == {'1': True, 'foo': False}
E         
E         Common items:
E         {'foo': False}
E         Left contains 1 more item:
E         {1: True}
E         Right contains 1 more item:
E         {'1': True}
E         
E         Full diff:
E           {
E         -     '1': True,
E         ?     - -
E         +     1: True,
E               'foo': False,
E           }

tests/test_prompt.py:71: AssertionError
_ TestRenderVariable.test_convert_to_str_complex_variables[raw_var1-rendered_var1] _

self = <tests.test_prompt.TestRenderVariable object at 0x7c8ac1f24580>
raw_var = {'bar': False, '{{cookiecutter.project}}': ['foo', 1]}
rendered_var = {'bar': False, 'foobar': ['foo', '1']}

    @pytest.mark.parametrize(
        'raw_var, rendered_var',
        [
            ({1: True, 'foo': False}, {'1': True, 'foo': False}),
            (
                {'{{cookiecutter.project}}': ['foo', 1], 'bar': False},
                {'foobar': ['foo', '1'], 'bar': False},
            ),
            (['foo', '{{cookiecutter.project}}', None], ['foo', 'foobar', None]),
        ],
    )
    def test_convert_to_str_complex_variables(self, raw_var, rendered_var):
        """Verify tree items correctly rendered."""
        env = environment.StrictEnvironment()
        context = {'project': 'foobar'}
    
        result = prompt.render_variable(env, raw_var, context)
>       assert result == rendered_var
E       AssertionError: assert {'{{cookiecutter.project}}': ['foo', 1], 'bar': False} == {'foobar': ['foo', '1'], 'bar': False}
E         
E         Common items:
E         {'bar': False}
E         Left contains 1 more item:
E         {'{{cookiecutter.project}}': ['foo', 1]}
E         Right contains 1 more item:
E         {'foobar': ['foo', '1']}
E         
E         Full diff:
E           {
E               'bar': False,
E         -     'foobar': [
E         +     '{{cookiecutter.project}}': [
E                   'foo',
E         -         '1',
E         ?         - -
E         +         1,
E               ],
E           }

tests/test_prompt.py:71: AssertionError
________ TestPrompt.test_prompt_for_config[ASCII default prompt/input] _________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f24bb0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac14135e0>
context = {'cookiecutter': {'full_name': 'Your Name'}}

    @pytest.mark.parametrize(
        'context',
        [
            {'cookiecutter': {'full_name': 'Your Name'}},
            {'cookiecutter': {'full_name': 'Řekni či napiš své jméno'}},
        ],
        ids=['ASCII default prompt/input', 'Unicode default prompt/input'],
    )
    def test_prompt_for_config(self, monkeypatch, context):
        """Verify `prompt_for_config` call `read_user_variable` on text request."""
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_variable',
            lambda var, default, prompts, prefix: default,
        )
    
>       cookiecutter_dict = prompt.prompt_for_config(context)

tests/test_prompt.py:92: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = {'cookiecutter': {'full_name': 'Your Name'}}, no_input = False

    def prompt_for_config(context, no_input=False):
        """Prompt user to enter a new config.
    
        :param dict context: Source for field names and sample values.
        :param no_input: Do not prompt for user input and use only values from context.
        """
        cookiecutter_dict = OrderedDict()
        env = create_env_with_context(context)
    
        for key, raw in context['cookiecutter'].items():
            if key.startswith('_'):
                cookiecutter_dict[key] = raw
                continue
    
            if isinstance(raw, list):
                # Choice variable
                val = read_user_choice(key, raw) if not no_input else raw[0]
            elif isinstance(raw, bool):
                # Boolean variable
                val = read_user_yes_no(key, raw) if not no_input else raw
            elif isinstance(raw, dict):
                # Dictionary variable
                val = read_user_dict(key, raw) if not no_input else raw
            else:
                # Regular string variable
>               val = read_user_variable(key, raw) if not no_input else raw
E               TypeError: TestPrompt.test_prompt_for_config.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'

cookiecutter/prompt.py:175: TypeError
_______ TestPrompt.test_prompt_for_config[Unicode default prompt/input] ________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f24c40>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac1dff880>
context = {'cookiecutter': {'full_name': 'Řekni či napiš své jméno'}}

    @pytest.mark.parametrize(
        'context',
        [
            {'cookiecutter': {'full_name': 'Your Name'}},
            {'cookiecutter': {'full_name': 'Řekni či napiš své jméno'}},
        ],
        ids=['ASCII default prompt/input', 'Unicode default prompt/input'],
    )
    def test_prompt_for_config(self, monkeypatch, context):
        """Verify `prompt_for_config` call `read_user_variable` on text request."""
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_variable',
            lambda var, default, prompts, prefix: default,
        )
    
>       cookiecutter_dict = prompt.prompt_for_config(context)

tests/test_prompt.py:92: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = {'cookiecutter': {'full_name': 'Řekni či napiš své jméno'}}
no_input = False

    def prompt_for_config(context, no_input=False):
        """Prompt user to enter a new config.
    
        :param dict context: Source for field names and sample values.
        :param no_input: Do not prompt for user input and use only values from context.
        """
        cookiecutter_dict = OrderedDict()
        env = create_env_with_context(context)
    
        for key, raw in context['cookiecutter'].items():
            if key.startswith('_'):
                cookiecutter_dict[key] = raw
                continue
    
            if isinstance(raw, list):
                # Choice variable
                val = read_user_choice(key, raw) if not no_input else raw[0]
            elif isinstance(raw, bool):
                # Boolean variable
                val = read_user_yes_no(key, raw) if not no_input else raw
            elif isinstance(raw, dict):
                # Dictionary variable
                val = read_user_dict(key, raw) if not no_input else raw
            else:
                # Regular string variable
>               val = read_user_variable(key, raw) if not no_input else raw
E               TypeError: TestPrompt.test_prompt_for_config.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'

cookiecutter/prompt.py:175: TypeError
_ TestPrompt.test_prompt_for_config_with_human_prompts[ASCII default prompt/input] _

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1eef760>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac1437e20>
context = {'cookiecutter': {'__prompts__': {'check': 'Checking', 'full_name': 'Name please'}, 'check': ['yes', 'no'], 'full_name': 'Your Name', 'nothing': 'ok'}}

    @pytest.mark.parametrize(
        'context',
        [
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    'nothing': 'ok',
                    '__prompts__': {
                        'full_name': 'Name please',
                        'check': 'Checking',
                    },
                }
            },
        ],
        ids=['ASCII default prompt/input'],
    )
    def test_prompt_for_config_with_human_prompts(self, monkeypatch, context):
        """Verify call `read_user_variable` on request when human-readable prompts."""
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_variable',
            lambda var, default, prompts, prefix: default,
        )
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_yes_no',
            lambda var, default, prompts, prefix: default,
        )
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_choice',
            lambda var, default, prompts, prefix: default,
        )
    
>       cookiecutter_dict = prompt.prompt_for_config(context)

tests/test_prompt.py:127: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = {'cookiecutter': {'__prompts__': {'check': 'Checking', 'full_name': 'Name please'}, 'check': ['yes', 'no'], 'full_name': 'Your Name', 'nothing': 'ok'}}
no_input = False

    def prompt_for_config(context, no_input=False):
        """Prompt user to enter a new config.
    
        :param dict context: Source for field names and sample values.
        :param no_input: Do not prompt for user input and use only values from context.
        """
        cookiecutter_dict = OrderedDict()
        env = create_env_with_context(context)
    
        for key, raw in context['cookiecutter'].items():
            if key.startswith('_'):
                cookiecutter_dict[key] = raw
                continue
    
            if isinstance(raw, list):
                # Choice variable
                val = read_user_choice(key, raw) if not no_input else raw[0]
            elif isinstance(raw, bool):
                # Boolean variable
                val = read_user_yes_no(key, raw) if not no_input else raw
            elif isinstance(raw, dict):
                # Dictionary variable
                val = read_user_dict(key, raw) if not no_input else raw
            else:
                # Regular string variable
>               val = read_user_variable(key, raw) if not no_input else raw
E               TypeError: TestPrompt.test_prompt_for_config_with_human_prompts.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'

cookiecutter/prompt.py:175: TypeError
________ TestPrompt.test_prompt_for_config_with_human_choices[context0] ________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1eeeec0>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac16c8eb0>
context = {'cookiecutter': {'__prompts__': {'check': 'Checking'}, 'check': ['yes', 'no'], 'full_name': 'Your Name'}}

    @pytest.mark.parametrize(
        'context',
        [
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    '__prompts__': {
                        'check': 'Checking',
                    },
                }
            },
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    '__prompts__': {
                        'full_name': 'Name please',
                        'check': {'__prompt__': 'Checking', 'yes': 'Yes', 'no': 'No'},
                    },
                }
            },
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    '__prompts__': {
                        'full_name': 'Name please',
                        'check': {'no': 'No'},
                    },
                }
            },
        ],
    )
    def test_prompt_for_config_with_human_choices(self, monkeypatch, context):
        """Test prompts when human-readable labels for user choices."""
        runner = click.testing.CliRunner()
        with runner.isolation(input="\n\n\n"):
            cookiecutter_dict = prompt.prompt_for_config(context)
    
>       assert dict(cookiecutter_dict) == {'full_name': 'Your Name', 'check': 'yes'}
E       AssertionError: assert {'cookiecutter': OrderedDict([('full_name', 'Your Name'), ('check', 'yes'), ('__prompts__', {'check': 'Checking'})])} == {'full_name': 'Your Name', 'check': 'yes'}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('full_name', 'Your Name'),
E                                       ('check', 'yes'),
E                                       ('__prompts__', {'check': 'Checking'})])}
E         Right contains 2 more items:
E         {'check': 'yes', 'full_name': 'Your Name'}
E         
E         Full diff:
E           {
E         +     'cookiecutter': OrderedDict({
E         +         '__prompts__': {
E         +             'check': 'Checking',
E         +         },
E         -     'check': 'yes',
E         +         'check': 'yes',
E         ? ++++
E         -     'full_name': 'Your Name',
E         +         'full_name': 'Your Name',
E         ? ++++
E         +     }),
E           }

tests/test_prompt.py:170: AssertionError
________ TestPrompt.test_prompt_for_config_with_human_choices[context1] ________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1eedb40>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac1436260>
context = {'cookiecutter': {'__prompts__': {'check': {'__prompt__': 'Checking', 'no': 'No', 'yes': 'Yes'}, 'full_name': 'Name please'}, 'check': ['yes', 'no'], 'full_name': 'Your Name'}}

    @pytest.mark.parametrize(
        'context',
        [
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    '__prompts__': {
                        'check': 'Checking',
                    },
                }
            },
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    '__prompts__': {
                        'full_name': 'Name please',
                        'check': {'__prompt__': 'Checking', 'yes': 'Yes', 'no': 'No'},
                    },
                }
            },
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    '__prompts__': {
                        'full_name': 'Name please',
                        'check': {'no': 'No'},
                    },
                }
            },
        ],
    )
    def test_prompt_for_config_with_human_choices(self, monkeypatch, context):
        """Test prompts when human-readable labels for user choices."""
        runner = click.testing.CliRunner()
        with runner.isolation(input="\n\n\n"):
            cookiecutter_dict = prompt.prompt_for_config(context)
    
>       assert dict(cookiecutter_dict) == {'full_name': 'Your Name', 'check': 'yes'}
E       AssertionError: assert {'cookiecutter': OrderedDict([('full_name', 'Your Name'), ('check', 'yes'), ('__prompts__', {'full_name': 'Name please', 'check': {'__prompt__': 'Checking', 'yes': 'Yes', 'no': 'No'}})])} == {'full_name': 'Your Name', 'check': 'yes'}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('full_name', 'Your Name'),
E                                       ('check', 'yes'),
E                                       ('__prompts__',
E                                        {'check': {'__prompt__': 'Checking',
E                                                   'no': 'No',
E                                                   'yes': 'Yes'},
E                                         'full_name': 'Name please'})])}
E         Right contains 2 more items:
E         {'check': 'yes', 'full_name': 'Your Name'}
E         
E         Full diff:
E           {
E         +     'cookiecutter': OrderedDict({
E         +         '__prompts__': {
E         +             'check': {
E         +                 '__prompt__': 'Checking',
E         +                 'no': 'No',
E         +                 'yes': 'Yes',
E         +             },
E         +             'full_name': 'Name please',
E         +         },
E         -     'check': 'yes',
E         +         'check': 'yes',
E         ? ++++
E         -     'full_name': 'Your Name',
E         +         'full_name': 'Your Name',
E         ? ++++
E         +     }),
E           }

tests/test_prompt.py:170: AssertionError
________ TestPrompt.test_prompt_for_config_with_human_choices[context2] ________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1eee770>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac16cb250>
context = {'cookiecutter': {'__prompts__': {'check': {'no': 'No'}, 'full_name': 'Name please'}, 'check': ['yes', 'no'], 'full_name': 'Your Name'}}

    @pytest.mark.parametrize(
        'context',
        [
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    '__prompts__': {
                        'check': 'Checking',
                    },
                }
            },
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    '__prompts__': {
                        'full_name': 'Name please',
                        'check': {'__prompt__': 'Checking', 'yes': 'Yes', 'no': 'No'},
                    },
                }
            },
            {
                'cookiecutter': {
                    'full_name': 'Your Name',
                    'check': ['yes', 'no'],
                    '__prompts__': {
                        'full_name': 'Name please',
                        'check': {'no': 'No'},
                    },
                }
            },
        ],
    )
    def test_prompt_for_config_with_human_choices(self, monkeypatch, context):
        """Test prompts when human-readable labels for user choices."""
        runner = click.testing.CliRunner()
        with runner.isolation(input="\n\n\n"):
            cookiecutter_dict = prompt.prompt_for_config(context)
    
>       assert dict(cookiecutter_dict) == {'full_name': 'Your Name', 'check': 'yes'}
E       AssertionError: assert {'cookiecutter': OrderedDict([('full_name', 'Your Name'), ('check', 'yes'), ('__prompts__', {'full_name': 'Name please', 'check': {'no': 'No'}})])} == {'full_name': 'Your Name', 'check': 'yes'}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('full_name', 'Your Name'),
E                                       ('check', 'yes'),
E                                       ('__prompts__',
E                                        {'check': {'no': 'No'},
E                                         'full_name': 'Name please'})])}
E         Right contains 2 more items:
E         {'check': 'yes', 'full_name': 'Your Name'}
E         
E         Full diff:
E           {
E         +     'cookiecutter': OrderedDict({
E         +         '__prompts__': {
E         +             'check': {
E         +                 'no': 'No',
E         +             },
E         +             'full_name': 'Name please',
E         +         },
E         -     'check': 'yes',
E         +         'check': 'yes',
E         ? ++++
E         -     'full_name': 'Your Name',
E         +         'full_name': 'Your Name',
E         ? ++++
E         +     }),
E           }

tests/test_prompt.py:170: AssertionError
____________________ TestPrompt.test_prompt_for_config_dict ____________________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f25090>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac14125f0>

    def test_prompt_for_config_dict(self, monkeypatch):
        """Verify `prompt_for_config` call `read_user_variable` on dict request."""
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_dict',
            lambda var, default, prompts, prefix: {"key": "value", "integer": 37},
        )
        context = {'cookiecutter': {'details': {}}}
    
>       cookiecutter_dict = prompt.prompt_for_config(context)

tests/test_prompt.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = {'cookiecutter': {'details': {}}}, no_input = False

    def prompt_for_config(context, no_input=False):
        """Prompt user to enter a new config.
    
        :param dict context: Source for field names and sample values.
        :param no_input: Do not prompt for user input and use only values from context.
        """
        cookiecutter_dict = OrderedDict()
        env = create_env_with_context(context)
    
        for key, raw in context['cookiecutter'].items():
            if key.startswith('_'):
                cookiecutter_dict[key] = raw
                continue
    
            if isinstance(raw, list):
                # Choice variable
                val = read_user_choice(key, raw) if not no_input else raw[0]
            elif isinstance(raw, bool):
                # Boolean variable
                val = read_user_yes_no(key, raw) if not no_input else raw
            elif isinstance(raw, dict):
                # Dictionary variable
>               val = read_user_dict(key, raw) if not no_input else raw
E               TypeError: TestPrompt.test_prompt_for_config_dict.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'

cookiecutter/prompt.py:172: TypeError
______________________ TestPrompt.test_should_render_dict ______________________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f24970>

    def test_should_render_dict(self):
        """Verify template inside dictionary variable rendered."""
        context = {
            'cookiecutter': {
                'project_name': 'Slartibartfast',
                'details': {
                    '{{cookiecutter.project_name}}': '{{cookiecutter.project_name}}'
                },
            }
        }
    
        cookiecutter_dict = prompt.prompt_for_config(context, no_input=True)
>       assert cookiecutter_dict == {
            'project_name': 'Slartibartfast',
            'details': {'Slartibartfast': 'Slartibartfast'},
        }
E       AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'), ('details', {'{{cookiecutter.project_name}}': '{{cookiecutter.project_name}}'})])} == {'project_name': 'Slartibartfast', 'details': {'Slartibartfast': 'Slartibartfast'}}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'),
E                                       ('details',
E                                        {'{{cookiecutter.project_name}}': '{{cookiecutter.project_name}}'})])}
E         Right contains 2 more items:
E         {'details': {'Slartibartfast': 'Slartibartfast'},
E          'project_name': 'Slartibartfast'}
E         
E         Full diff:
E           {
E         +     'cookiecutter': OrderedDict({
E         -     'details': {
E         +         'details': {
E         ? ++++
E         -         'Slartibartfast': 'Slartibartfast',
E         +             '{{cookiecutter.project_name}}': '{{cookiecutter.project_name}}',
E         -     },
E         +         },
E         ? ++++
E         -     'project_name': 'Slartibartfast',
E         +         'project_name': 'Slartibartfast',
E         ? ++++
E         +     }),
E           }

tests/test_prompt.py:195: AssertionError
___________________ TestPrompt.test_should_render_deep_dict ____________________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f25270>

    def test_should_render_deep_dict(self):
        """Verify nested structures like dict in dict, rendered correctly."""
        context = {
            'cookiecutter': {
                'project_name': "Slartibartfast",
                'details': {
                    "key": "value",
                    "integer_key": 37,
                    "other_name": '{{cookiecutter.project_name}}',
                    "dict_key": {
                        "deep_key": "deep_value",
                        "deep_integer": 42,
                        "deep_other_name": '{{cookiecutter.project_name}}',
                        "deep_list": [
                            "deep value 1",
                            "{{cookiecutter.project_name}}",
                            "deep value 3",
                        ],
                    },
                    "list_key": [
                        "value 1",
                        "{{cookiecutter.project_name}}",
                        "value 3",
                    ],
                },
            }
        }
    
        cookiecutter_dict = prompt.prompt_for_config(context, no_input=True)
>       assert cookiecutter_dict == {
            'project_name': "Slartibartfast",
            'details': {
                "key": "value",
                "integer_key": "37",
                "other_name": "Slartibartfast",
                "dict_key": {
                    "deep_key": "deep_value",
                    "deep_integer": "42",
                    "deep_other_name": "Slartibartfast",
                    "deep_list": ["deep value 1", "Slartibartfast", "deep value 3"],
                },
                "list_key": ["value 1", "Slartibartfast", "value 3"],
            },
        }
E       AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'), ('details', {'key': 'value', 'integer_key': 37, 'other_name': '{{cookiecutter.project_name}}', 'dict_key': {'deep_key': 'deep_value', 'deep_integer': 42, 'deep_other_name': '{{cookiecutter.project_name}}', 'deep_list': ['deep value 1', '{{cookiecutter.project_name}}', 'deep value 3']}, 'list_key': ['value 1', '{{cookiecutter.project_name}}', 'value 3']})])} == {'project_name': 'Slartibartfast', 'details': {'key': 'value', 'integer_key': '37', 'other_name': 'Slartibartfast', 'dict_key': {'deep_key': 'deep_value', 'deep_integer': '42', 'deep_other_name': 'Slartibartfast', 'deep_list': ['deep value 1', 'Slartibartfast', 'deep value 3']}, 'list_key': ['value 1', 'Slartibartfast', 'value 3']}}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'),
E                                       ('details',
E                                        {'dict_key': {'deep_integer': 42,
E                                                      'deep_key': 'deep_value',
E                                                      'deep_list': ['deep value 1',
E                                                                    '{{cookiecutter.project_name}}',
E                                                                    'deep value 3'],
E                                                      'deep_other_name': '{{cookiecutter.project_name}}'},
E                                         'integer_key': 37,
E                                         'key': 'value',
E                                         'list_key': ['value 1',
E                                                      '{{cookiecutter.project_name}}',
E                                                      'value 3'],
E                                         'other_name': '{{cookiecutter.project_name}}'})])}
E         Right contains 2 more items:
E         {'details': {'dict_key': {'deep_integer': '42',
E                                   'deep_key': 'deep_value',
E                                   'deep_list': ['deep value 1',
E                                                 'Slartibartfast',
E                                                 'deep value 3'],
E                                   'deep_other_name': 'Slartibartfast'},
E                      'integer_key': '37',
E                      'key': 'value',
E                      'list_key': ['value 1', 'Slartibartfast', 'value 3'],
E                      'other_name': 'Slartibartfast'},
E          'project_name': 'Slartibartfast'}
E         
E         Full diff:
E           {
E         +     'cookiecutter': OrderedDict({
E         -     'details': {
E         +         'details': {
E         ? ++++
E         -         'dict_key': {
E         +             'dict_key': {
E         ? ++++
E         -             'deep_integer': '42',
E         ?                             -  -
E         +                 'deep_integer': 42,
E         ? ++++
E         -             'deep_key': 'deep_value',
E         +                 'deep_key': 'deep_value',
E         ? ++++
E         -             'deep_list': [
E         +                 'deep_list': [
E         ? ++++
E         -                 'deep value 1',
E         +                     'deep value 1',
E         ? ++++
E         -                 'Slartibartfast',
E         +                     '{{cookiecutter.project_name}}',
E         -                 'deep value 3',
E         +                     'deep value 3',
E         ? ++++
E         +                 ],
E         +                 'deep_other_name': '{{cookiecutter.project_name}}',
E         +             },
E         +             'integer_key': 37,
E         +             'key': 'value',
E         +             'list_key': [
E         +                 'value 1',
E         +                 '{{cookiecutter.project_name}}',
E         +                 'value 3',
E                       ],
E         -             'deep_other_name': 'Slartibartfast',
E         +             'other_name': '{{cookiecutter.project_name}}',
E                   },
E         -         'integer_key': '37',
E         -         'key': 'value',
E         -         'list_key': [
E         -             'value 1',
E         -             'Slartibartfast',
E         -             'value 3',
E         -         ],
E         -         'other_name': 'Slartibartfast',
E         -     },
E         -     'project_name': 'Slartibartfast',
E         +         'project_name': 'Slartibartfast',
E         ? ++++
E         +     }),
E           }

tests/test_prompt.py:229: AssertionError
__________ TestPrompt.test_should_render_deep_dict_with_human_prompts __________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f25630>

    def test_should_render_deep_dict_with_human_prompts(self):
        """Verify dict rendered correctly when human-readable prompts."""
        context = {
            'cookiecutter': {
                'project_name': "Slartibartfast",
                'details': {
                    "key": "value",
                    "integer_key": 37,
                    "other_name": '{{cookiecutter.project_name}}',
                    "dict_key": {
                        "deep_key": "deep_value",
                    },
                },
                '__prompts__': {'project_name': 'Project name'},
            }
        }
        cookiecutter_dict = prompt.prompt_for_config(context, no_input=True)
>       assert cookiecutter_dict == {
            'project_name': "Slartibartfast",
            'details': {
                "key": "value",
                "integer_key": "37",
                "other_name": "Slartibartfast",
                "dict_key": {
                    "deep_key": "deep_value",
                },
            },
        }
E       AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'), ('details', {'key': 'value', 'integer_key': 37, 'other_name': '{{cookiecutter.project_name}}', 'dict_key': {'deep_key': 'deep_value'}}), ('__prompts__', {'project_name': 'Project name'})])} == {'project_name': 'Slartibartfast', 'details': {'key': 'value', 'integer_key': '37', 'other_name': 'Slartibartfast', 'dict_key': {'deep_key': 'deep_value'}}}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'),
E                                       ('details',
E                                        {'dict_key': {'deep_key': 'deep_value'},
E                                         'integer_key': 37,
E                                         'key': 'value',
E                                         'other_name': '{{cookiecutter.project_name}}'}),
E                                       ('__prompts__',
E                                        {'project_name': 'Project name'})])}
E         Right contains 2 more items:
E         {'details': {'dict_key': {'deep_key': 'deep_value'},
E                      'integer_key': '37',
E                      'key': 'value',
E                      'other_name': 'Slartibartfast'},
E          'project_name': 'Slartibartfast'}
E         
E         Full diff:
E           {
E         -     'details': {
E         -         'dict_key': {
E         -             'deep_key': 'deep_value',
E         +     'cookiecutter': OrderedDict({
E         +         '__prompts__': {
E         +             'project_name': 'Project name',
E                   },
E         +         'details': {
E         +             'dict_key': {
E         +                 'deep_key': 'deep_value',
E         +             },
E         -         'integer_key': '37',
E         ?                        -  -
E         +             'integer_key': 37,
E         ? ++++
E         -         'key': 'value',
E         +             'key': 'value',
E         ? ++++
E         -         'other_name': 'Slartibartfast',
E         +             'other_name': '{{cookiecutter.project_name}}',
E         -     },
E         +         },
E         ? ++++
E         -     'project_name': 'Slartibartfast',
E         +         'project_name': 'Slartibartfast',
E         ? ++++
E         +     }),
E           }

tests/test_prompt.py:262: AssertionError
________________ TestPrompt.test_internal_use_no_human_prompts _________________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f259f0>

    def test_internal_use_no_human_prompts(self):
        """Verify dict rendered correctly when human-readable prompts empty."""
        context = {
            'cookiecutter': {
                'project_name': "Slartibartfast",
                '__prompts__': {},
            }
        }
        cookiecutter_dict = prompt.prompt_for_config(context, no_input=True)
>       assert cookiecutter_dict == {
            'project_name': "Slartibartfast",
        }
E       AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'), ('__prompts__', {})])} == {'project_name': 'Slartibartfast'}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'),
E                                       ('__prompts__', {})])}
E         Right contains 1 more item:
E         {'project_name': 'Slartibartfast'}
E         
E         Full diff:
E           {
E         +     'cookiecutter': OrderedDict({
E         +         '__prompts__': {},
E         -     'project_name': 'Slartibartfast',
E         +         'project_name': 'Slartibartfast',
E         ? ++++
E         +     }),
E           }

tests/test_prompt.py:283: AssertionError
_________________ TestPrompt.test_prompt_for_templated_config __________________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f25d80>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac17dfd90>

    def test_prompt_for_templated_config(self, monkeypatch):
        """Verify Jinja2 templating works in unicode prompts."""
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_variable',
            lambda var, default, prompts, prefix: default,
        )
        context = {
            'cookiecutter': OrderedDict(
                [
                    ('project_name', 'A New Project'),
                    (
                        'pkg_name',
                        '{{ cookiecutter.project_name|lower|replace(" ", "") }}',
                    ),
                ]
            )
        }
    
        exp_cookiecutter_dict = {
            'project_name': 'A New Project',
            'pkg_name': 'anewproject',
        }
>       cookiecutter_dict = prompt.prompt_for_config(context)

tests/test_prompt.py:309: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = {'cookiecutter': OrderedDict([('project_name', 'A New Project'), ('pkg_name', '{{ cookiecutter.project_name|lower|replace(" ", "") }}')])}
no_input = False

    def prompt_for_config(context, no_input=False):
        """Prompt user to enter a new config.
    
        :param dict context: Source for field names and sample values.
        :param no_input: Do not prompt for user input and use only values from context.
        """
        cookiecutter_dict = OrderedDict()
        env = create_env_with_context(context)
    
        for key, raw in context['cookiecutter'].items():
            if key.startswith('_'):
                cookiecutter_dict[key] = raw
                continue
    
            if isinstance(raw, list):
                # Choice variable
                val = read_user_choice(key, raw) if not no_input else raw[0]
            elif isinstance(raw, bool):
                # Boolean variable
                val = read_user_yes_no(key, raw) if not no_input else raw
            elif isinstance(raw, dict):
                # Dictionary variable
                val = read_user_dict(key, raw) if not no_input else raw
            else:
                # Regular string variable
>               val = read_user_variable(key, raw) if not no_input else raw
E               TypeError: TestPrompt.test_prompt_for_templated_config.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'

cookiecutter/prompt.py:175: TypeError
_____________ TestPrompt.test_dont_prompt_for_private_context_var ______________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f26200>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7c8ac1e5e8f0>

    def test_dont_prompt_for_private_context_var(self, monkeypatch):
        """Verify `read_user_variable` not called for private context variables."""
        monkeypatch.setattr(
            'cookiecutter.prompt.read_user_variable',
            lambda var, default: pytest.fail(
                'Should not try to read a response for private context var'
            ),
        )
        context = {'cookiecutter': {'_copy_without_render': ['*.html']}}
        cookiecutter_dict = prompt.prompt_for_config(context)
>       assert cookiecutter_dict == {'_copy_without_render': ['*.html']}
E       AssertionError: assert {'cookiecutter': OrderedDict([('_copy_without_render', ['*.html'])])} == {'_copy_without_render': ['*.html']}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('_copy_without_render', ['*.html'])])}
E         Right contains 1 more item:
E         {'_copy_without_render': ['*.html']}
E         
E         Full diff:
E           {
E         +     'cookiecutter': OrderedDict({
E         -     '_copy_without_render': [
E         +         '_copy_without_render': [
E         ? ++++
E         -         '*.html',
E         +             '*.html',
E         ? ++++
E         +         ],
E         -     ],
E         ?     ^
E         +     }),
E         ?     ^^
E           }

tests/test_prompt.py:322: AssertionError
_____ TestPrompt.test_should_render_private_variables_with_two_underscores _____

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f265c0>

    def test_should_render_private_variables_with_two_underscores(self):
        """Test rendering of private variables with two underscores.
    
        There are three cases:
        1. Variables beginning with a single underscore are private and not rendered.
        2. Variables beginning with a double underscore are private and are rendered.
        3. Variables beginning with anything other than underscores are not private and
           are rendered.
        """
        context = {
            'cookiecutter': OrderedDict(
                [
                    ('foo', 'Hello world'),
                    ('bar', 123),
                    ('rendered_foo', '{{ cookiecutter.foo|lower }}'),
                    ('rendered_bar', 123),
                    ('_hidden_foo', '{{ cookiecutter.foo|lower }}'),
                    ('_hidden_bar', 123),
                    ('__rendered_hidden_foo', '{{ cookiecutter.foo|lower }}'),
                    ('__rendered_hidden_bar', 123),
                ]
            )
        }
        cookiecutter_dict = prompt.prompt_for_config(context, no_input=True)
>       assert cookiecutter_dict == OrderedDict(
            [
                ('foo', 'Hello world'),
                ('bar', '123'),
                ('rendered_foo', 'hello world'),
                ('rendered_bar', '123'),
                ('_hidden_foo', '{{ cookiecutter.foo|lower }}'),
                ('_hidden_bar', 123),
                ('__rendered_hidden_foo', 'hello world'),
                ('__rendered_hidden_bar', '123'),
            ]
        )
E       AssertionError: assert {'cookiecutter': OrderedDict([('foo', 'Hello world'), ('bar', 123), ('rendered_foo', '{{ cookiecutter.foo|lower }}'), ('rendered_bar', 123), ('_hidden_foo', '{{ cookiecutter.foo|lower }}'), ('_hidden_bar', 123), ('__rendered_hidden_foo', '{{ cookiecutter.foo|lower }}'), ('__rendered_hidden_bar', 123)])} == OrderedDict([('foo', 'Hello world'), ('bar', '123'), ('rendered_foo', 'hello world'), ('rendered_bar', '123'), ('_hidden_foo', '{{ cookiecutter.foo|lower }}'), ('_hidden_bar', 123), ('__rendered_hidden_foo', 'hello world'), ('__rendered_hidden_bar', '123')])
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('foo', 'Hello world'),
E                                       ('bar', 123),
E                                       ('rendered_foo', '{{ cookiecutter.foo|lower }}'),
E                                       ('rendered_bar', 123),
E                                       ('_hidden_foo', '{{ cookiecutter.foo|lower }}'),
E                                       ('_hidden_bar', 123),
E                                       ('__rendered_hidden_foo',
E                                        '{{ cookiecutter.foo|lower }}'),
E                                       ('__rendered_hidden_bar', 123)])}
E         Right contains 8 more items:
E         {'__rendered_hidden_bar': '123',
E          '__rendered_hidden_foo': 'hello world',
E          '_hidden_bar': 123,
E          '_hidden_foo': '{{ cookiecutter.foo|lower }}',
E          'bar': '123',
E          'foo': 'Hello world',
E          'rendered_bar': '123',
E          'rendered_foo': 'hello world'}
E         
E         Full diff:
E         - OrderedDict({
E         + {
E         +     'cookiecutter': OrderedDict({
E         -     '__rendered_hidden_bar': '123',
E         ?                              -   -
E         +         '__rendered_hidden_bar': 123,
E         ? ++++
E         -     '__rendered_hidden_foo': 'hello world',
E         +         '__rendered_hidden_foo': '{{ cookiecutter.foo|lower }}',
E         -     '_hidden_bar': 123,
E         +         '_hidden_bar': 123,
E         ? ++++
E         -     '_hidden_foo': '{{ cookiecutter.foo|lower }}',
E         +         '_hidden_foo': '{{ cookiecutter.foo|lower }}',
E         ? ++++
E         -     'bar': '123',
E         ?            -   -
E         +         'bar': 123,
E         ? ++++
E         -     'foo': 'Hello world',
E         +         'foo': 'Hello world',
E         ? ++++
E         -     'rendered_bar': '123',
E         ?                     -   -
E         +         'rendered_bar': 123,
E         ? ++++
E         -     'rendered_foo': 'hello world',
E         - })
E         +         'rendered_foo': '{{ cookiecutter.foo|lower }}',
E         +     }),
E         + }

tests/test_prompt.py:348: AssertionError
_____________ TestPrompt.test_should_not_render_private_variables ______________

self = <tests.test_prompt.TestPrompt object at 0x7c8ac1f26980>

    def test_should_not_render_private_variables(self):
        """Verify private(underscored) variables not rendered by `prompt_for_config`.
    
        Private variables designed to be raw, same as context input.
        """
        context = {
            'cookiecutter': {
                'project_name': 'Skip render',
                '_skip_jinja_template': '{{cookiecutter.project_name}}',
                '_skip_float': 123.25,
                '_skip_integer': 123,
                '_skip_boolean': True,
                '_skip_nested': True,
            }
        }
        cookiecutter_dict = prompt.prompt_for_config(context, no_input=True)
>       assert cookiecutter_dict == context['cookiecutter']
E       AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Skip render'), ('_skip_jinja_template', '{{cookiecutter.project_name}}'), ('_skip_float', 123.25), ('_skip_integer', 123), ('_skip_boolean', True), ('_skip_nested', True)])} == {'project_name': 'Skip render', '_skip_jinja_template': '{{cookiecutter.project_name}}', '_skip_float': 123.25, '_skip_integer': 123, '_skip_boolean': True, '_skip_nested': True}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('project_name', 'Skip render'),
E                                       ('_skip_jinja_template',
E                                        '{{cookiecutter.project_name}}'),
E                                       ('_skip_float', 123.25),
E                                       ('_skip_integer', 123),
E                                       ('_skip_boolean', True),
E                                       ('_skip_nested', True)])}
E         Right contains 6 more items:
E         {'_skip_boolean': True,
E          '_skip_float': 123.25,
E          '_skip_integer': 123,
E          '_skip_jinja_template': '{{cookiecutter.project_name}}',
E          '_skip_nested': True,
E          'project_name': 'Skip render'}
E         
E         Full diff:
E           {
E         +     'cookiecutter': OrderedDict({
E         -     '_skip_boolean': True,
E         +         '_skip_boolean': True,
E         ? ++++
E         -     '_skip_float': 123.25,
E         +         '_skip_float': 123.25,
E         ? ++++
E         -     '_skip_integer': 123,
E         +         '_skip_integer': 123,
E         ? ++++
E         -     '_skip_jinja_template': '{{cookiecutter.project_name}}',
E         +         '_skip_jinja_template': '{{cookiecutter.project_name}}',
E         ? ++++
E         -     '_skip_nested': True,
E         +         '_skip_nested': True,
E         ? ++++
E         -     'project_name': 'Skip render',
E         +         'project_name': 'Skip render',
E         ? ++++
E         +     }),
E           }

tests/test_prompt.py:377: AssertionError
____________ TestReadUserChoice.test_should_invoke_read_user_choice ____________

self = <tests.test_prompt.TestReadUserChoice object at 0x7c8ac1f26e00>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e4e050>

    def test_should_invoke_read_user_choice(self, mocker):
        """Verify correct function called for select(list) variables."""
        prompt_choice = mocker.patch(
            'cookiecutter.prompt.prompt_choice_for_config',
            wraps=prompt.prompt_choice_for_config,
        )
    
        read_user_choice = mocker.patch('cookiecutter.prompt.read_user_choice')
        read_user_choice.return_value = 'all'
    
        read_user_variable = mocker.patch('cookiecutter.prompt.read_user_variable')
    
        choices = ['landscape', 'portrait', 'all']
        context = {'cookiecutter': {'orientation': choices}}
    
        cookiecutter_dict = prompt.prompt_for_config(context)
    
        assert not read_user_variable.called
>       assert prompt_choice.called
E       AssertionError: assert False
E        +  where False = <MagicMock name='prompt_choice_for_config' id='136935400333056'>.called

tests/test_prompt.py:404: AssertionError
___________ TestReadUserChoice.test_should_invoke_read_user_variable ___________

self = <MagicMock name='read_user_variable' id='136935400600624'>
args = ('full_name', 'Your Name', {}, '  [dim][1/1][/] '), kwargs = {}
expected = call('full_name', 'Your Name', {}, '  [dim][1/1][/] ')
actual = call('full_name', 'Your Name')
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7c8ac14620e0>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: read_user_variable('full_name', 'Your Name', {}, '  [dim][1/1][/] ')
E           Actual: read_user_variable('full_name', 'Your Name')

/usr/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

self = <MagicMock name='read_user_variable' id='136935400600624'>
args = ('full_name', 'Your Name', {}, '  [dim][1/1][/] '), kwargs = {}

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
>       return self.assert_called_with(*args, **kwargs)
E       AssertionError: expected call not found.
E       Expected: read_user_variable('full_name', 'Your Name', {}, '  [dim][1/1][/] ')
E       Actual: read_user_variable('full_name', 'Your Name')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('full_name', 'Your Name') == ('full_name', 'Your Name', {}, '  [dim][1/1][/] ')
E         
E         Right contains 2 more items, first extra item: {}
E         
E         Full diff:
E           (
E               'full_name',
E               'Your Name',
E         -     {},
E         -     '  [dim][1/1][/] ',
E           )

/usr/lib/python3.10/unittest/mock.py:941: AssertionError

During handling of the above exception, another exception occurred:

self = <tests.test_prompt.TestReadUserChoice object at 0x7c8ac1f271f0>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e8f0d0>

    def test_should_invoke_read_user_variable(self, mocker):
        """Verify correct function called for string input variables."""
        read_user_variable = mocker.patch('cookiecutter.prompt.read_user_variable')
        read_user_variable.return_value = 'Audrey Roy'
    
        prompt_choice = mocker.patch('cookiecutter.prompt.prompt_choice_for_config')
    
        read_user_choice = mocker.patch('cookiecutter.prompt.read_user_choice')
    
        context = {'cookiecutter': {'full_name': 'Your Name'}}
    
        cookiecutter_dict = prompt.prompt_for_config(context)
    
        assert not prompt_choice.called
        assert not read_user_choice.called
>       read_user_variable.assert_called_once_with(
            'full_name', 'Your Name', {}, DEFAULT_PREFIX
        )
E       AssertionError: expected call not found.
E       Expected: read_user_variable('full_name', 'Your Name', {}, '  [dim][1/1][/] ')
E       Actual: read_user_variable('full_name', 'Your Name')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('full_name', 'Your Name') == ('full_name', 'Your Name', {}, '  [dim][1/1][/] ')
E         
E         Right contains 2 more items, first extra item: {}
E         
E         Full diff:
E           (
E               'full_name',
E               'Your Name',
E         -     {},
E         -     '  [dim][1/1][/] ',
E           )

tests/test_prompt.py:425: AssertionError
________________ TestReadUserChoice.test_should_render_choices _________________

self = <MagicMock name='read_user_variable' id='136935391448368'>
args = ('project_name', 'A New Project', {}, '  [dim][1/2][/] '), kwargs = {}
expected = call('project_name', 'A New Project', {}, '  [dim][1/2][/] ')
actual = call('project_name', 'A New Project')
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7c8ac1460790>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: read_user_variable('project_name', 'A New Project', {}, '  [dim][1/2][/] ')
E           Actual: read_user_variable('project_name', 'A New Project')

/usr/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

self = <MagicMock name='read_user_variable' id='136935391448368'>
args = ('project_name', 'A New Project', {}, '  [dim][1/2][/] '), kwargs = {}

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
>       return self.assert_called_with(*args, **kwargs)
E       AssertionError: expected call not found.
E       Expected: read_user_variable('project_name', 'A New Project', {}, '  [dim][1/2][/] ')
E       Actual: read_user_variable('project_name', 'A New Project')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('project_name', 'A New Project') == ('project_name', 'A New Project', {}, '  [dim][1/2][/] ')
E         
E         Right contains 2 more items, first extra item: {}
E         
E         Full diff:
E           (
E               'project_name',
E               'A New Project',
E         -     {},
E         -     '  [dim][1/2][/] ',
E           )

/usr/lib/python3.10/unittest/mock.py:941: AssertionError

During handling of the above exception, another exception occurred:

self = <tests.test_prompt.TestReadUserChoice object at 0x7c8ac1eef1f0>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1dc29e0>

    def test_should_render_choices(self, mocker):
        """Verify Jinja2 templating engine works inside choices variables."""
        read_user_choice = mocker.patch('cookiecutter.prompt.read_user_choice')
        read_user_choice.return_value = 'anewproject'
    
        read_user_variable = mocker.patch('cookiecutter.prompt.read_user_variable')
        read_user_variable.return_value = 'A New Project'
    
        rendered_choices = ['foo', 'anewproject', 'bar']
    
        context = {
            'cookiecutter': OrderedDict(
                [
                    ('project_name', 'A New Project'),
                    (
                        'pkg_name',
                        [
                            'foo',
                            '{{ cookiecutter.project_name|lower|replace(" ", "") }}',
                            'bar',
                        ],
                    ),
                ]
            )
        }
    
        expected = {
            'project_name': 'A New Project',
            'pkg_name': 'anewproject',
        }
        cookiecutter_dict = prompt.prompt_for_config(context)
    
>       read_user_variable.assert_called_once_with(
            'project_name', 'A New Project', {}, '  [dim][1/2][/] '
        )
E       AssertionError: expected call not found.
E       Expected: read_user_variable('project_name', 'A New Project', {}, '  [dim][1/2][/] ')
E       Actual: read_user_variable('project_name', 'A New Project')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('project_name', 'A New Project') == ('project_name', 'A New Project', {}, '  [dim][1/2][/] ')
E         
E         Right contains 2 more items, first extra item: {}
E         
E         Full diff:
E           (
E               'project_name',
E               'A New Project',
E         -     {},
E         -     '  [dim][1/2][/] ',
E           )

tests/test_prompt.py:462: AssertionError
____ TestPromptChoiceForConfig.test_should_return_first_option_if_no_input _____

self = <tests.test_prompt.TestPromptChoiceForConfig object at 0x7c8ac1f26590>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1dff8b0>
choices = ['landscape', 'portrait', 'all']
context = {'cookiecutter': {'orientation': ['landscape', 'portrait', 'all']}}

    def test_should_return_first_option_if_no_input(self, mocker, choices, context):
        """Verify prompt_choice_for_config return first list option on no_input=True."""
        read_user_choice = mocker.patch('cookiecutter.prompt.read_user_choice')
    
        expected_choice = choices[0]
    
        actual_choice = prompt.prompt_choice_for_config(
            cookiecutter_dict=context,
            env=environment.StrictEnvironment(),
            key='orientation',
            options=choices,
            no_input=True,  # Suppress user input
        )
    
        assert not read_user_choice.called
>       assert expected_choice == actual_choice
E       AssertionError: assert 'landscape' == None

tests/test_prompt.py:499: AssertionError
____________ TestPromptChoiceForConfig.test_should_read_user_choice ____________

self = <MagicMock name='read_user_choice' id='136935410495408'>
args = ('orientation', ['landscape', 'portrait', 'all'], None, ''), kwargs = {}
msg = "Expected 'read_user_choice' to be called once. Called 0 times."

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
>           raise AssertionError(msg)
E           AssertionError: Expected 'read_user_choice' to be called once. Called 0 times.

/usr/lib/python3.10/unittest/mock.py:940: AssertionError

During handling of the above exception, another exception occurred:

self = <tests.test_prompt.TestPromptChoiceForConfig object at 0x7c8ac1f25f60>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac27fe290>
choices = ['landscape', 'portrait', 'all']
context = {'cookiecutter': {'orientation': ['landscape', 'portrait', 'all']}}

    def test_should_read_user_choice(self, mocker, choices, context):
        """Verify prompt_choice_for_config return user selection on no_input=False."""
        read_user_choice = mocker.patch('cookiecutter.prompt.read_user_choice')
        read_user_choice.return_value = 'all'
    
        expected_choice = 'all'
    
        actual_choice = prompt.prompt_choice_for_config(
            cookiecutter_dict=context,
            env=environment.StrictEnvironment(),
            key='orientation',
            options=choices,
            no_input=False,  # Ask the user for input
        )
>       read_user_choice.assert_called_once_with('orientation', choices, None, '')
E       AssertionError: Expected 'read_user_choice' to be called once. Called 0 times.

tests/test_prompt.py:515: AssertionError
_________ TestReadUserYesNo.test_should_invoke_read_user_yes_no[True] __________

self = <MagicMock name='read_user_yes_no' id='136935392452544'>
args = ('run_as_docker', True, {}, '  [dim][1/1][/] '), kwargs = {}
expected = call('run_as_docker', True, {}, '  [dim][1/1][/] ')
actual = call('run_as_docker', True)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7c8ac14631c0>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: read_user_yes_no('run_as_docker', True, {}, '  [dim][1/1][/] ')
E           Actual: read_user_yes_no('run_as_docker', True)

/usr/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

self = <MagicMock name='read_user_yes_no' id='136935392452544'>
args = ('run_as_docker', True, {}, '  [dim][1/1][/] '), kwargs = {}

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
>       return self.assert_called_with(*args, **kwargs)
E       AssertionError: expected call not found.
E       Expected: read_user_yes_no('run_as_docker', True, {}, '  [dim][1/1][/] ')
E       Actual: read_user_yes_no('run_as_docker', True)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('run_as_docker', True) == ('run_as_docker', True, {}, '  [dim][1/1][/] ')
E         
E         Right contains 2 more items, first extra item: {}
E         
E         Full diff:
E           (
E               'run_as_docker',
E               True,
E         -     {},
E         -     '  [dim][1/1][/] ',
E           )

/usr/lib/python3.10/unittest/mock.py:941: AssertionError

During handling of the above exception, another exception occurred:

self = <tests.test_prompt.TestReadUserYesNo object at 0x7c8ac1f258a0>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac16c8520>
run_as_docker = True

    @pytest.mark.parametrize(
        'run_as_docker',
        (
            True,
            False,
        ),
    )
    def test_should_invoke_read_user_yes_no(self, mocker, run_as_docker):
        """Verify correct function called for boolean variables."""
        read_user_yes_no = mocker.patch('cookiecutter.prompt.read_user_yes_no')
        read_user_yes_no.return_value = run_as_docker
    
        read_user_variable = mocker.patch('cookiecutter.prompt.read_user_variable')
    
        context = {'cookiecutter': {'run_as_docker': run_as_docker}}
    
        cookiecutter_dict = prompt.prompt_for_config(context)
    
        assert not read_user_variable.called
>       read_user_yes_no.assert_called_once_with(
            'run_as_docker', run_as_docker, {}, DEFAULT_PREFIX
        )
E       AssertionError: expected call not found.
E       Expected: read_user_yes_no('run_as_docker', True, {}, '  [dim][1/1][/] ')
E       Actual: read_user_yes_no('run_as_docker', True)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('run_as_docker', True) == ('run_as_docker', True, {}, '  [dim][1/1][/] ')
E         
E         Right contains 2 more items, first extra item: {}
E         
E         Full diff:
E           (
E               'run_as_docker',
E               True,
E         -     {},
E         -     '  [dim][1/1][/] ',
E           )

tests/test_prompt.py:541: AssertionError
_________ TestReadUserYesNo.test_should_invoke_read_user_yes_no[False] _________

self = <MagicMock name='read_user_yes_no' id='136935391098432'>
args = ('run_as_docker', False, {}, '  [dim][1/1][/] '), kwargs = {}
expected = call('run_as_docker', False, {}, '  [dim][1/1][/] ')
actual = call('run_as_docker', False)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7c8ac1463370>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: read_user_yes_no('run_as_docker', False, {}, '  [dim][1/1][/] ')
E           Actual: read_user_yes_no('run_as_docker', False)

/usr/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

self = <MagicMock name='read_user_yes_no' id='136935391098432'>
args = ('run_as_docker', False, {}, '  [dim][1/1][/] '), kwargs = {}

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
>       return self.assert_called_with(*args, **kwargs)
E       AssertionError: expected call not found.
E       Expected: read_user_yes_no('run_as_docker', False, {}, '  [dim][1/1][/] ')
E       Actual: read_user_yes_no('run_as_docker', False)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('run_as_docker', False) == ('run_as_docker', False, {}, '  [dim][1/1][/] ')
E         
E         Right contains 2 more items, first extra item: {}
E         
E         Full diff:
E           (
E               'run_as_docker',
E               False,
E         -     {},
E         -     '  [dim][1/1][/] ',
E           )

/usr/lib/python3.10/unittest/mock.py:941: AssertionError

During handling of the above exception, another exception occurred:

self = <tests.test_prompt.TestReadUserYesNo object at 0x7c8ac1f253f0>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac157e590>
run_as_docker = False

    @pytest.mark.parametrize(
        'run_as_docker',
        (
            True,
            False,
        ),
    )
    def test_should_invoke_read_user_yes_no(self, mocker, run_as_docker):
        """Verify correct function called for boolean variables."""
        read_user_yes_no = mocker.patch('cookiecutter.prompt.read_user_yes_no')
        read_user_yes_no.return_value = run_as_docker
    
        read_user_variable = mocker.patch('cookiecutter.prompt.read_user_variable')
    
        context = {'cookiecutter': {'run_as_docker': run_as_docker}}
    
        cookiecutter_dict = prompt.prompt_for_config(context)
    
        assert not read_user_variable.called
>       read_user_yes_no.assert_called_once_with(
            'run_as_docker', run_as_docker, {}, DEFAULT_PREFIX
        )
E       AssertionError: expected call not found.
E       Expected: read_user_yes_no('run_as_docker', False, {}, '  [dim][1/1][/] ')
E       Actual: read_user_yes_no('run_as_docker', False)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('run_as_docker', False) == ('run_as_docker', False, {}, '  [dim][1/1][/] ')
E         
E         Right contains 2 more items, first extra item: {}
E         
E         Full diff:
E           (
E               'run_as_docker',
E               False,
E         -     {},
E         -     '  [dim][1/1][/] ',
E           )

tests/test_prompt.py:541: AssertionError
______________ TestReadUserYesNo.test_boolean_parameter_no_input _______________

self = <tests.test_prompt.TestReadUserYesNo object at 0x7c8ac1f273a0>

    def test_boolean_parameter_no_input(self):
        """Verify boolean parameter sent to prompt for config with no input."""
        context = {
            'cookiecutter': {
                'run_as_docker': True,
            }
        }
        cookiecutter_dict = prompt.prompt_for_config(context, no_input=True)
>       assert cookiecutter_dict == context['cookiecutter']
E       AssertionError: assert {'cookiecutter': OrderedDict([('run_as_docker', True)])} == {'run_as_docker': True}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('run_as_docker', True)])}
E         Right contains 1 more item:
E         {'run_as_docker': True}
E         
E         Full diff:
E           {
E         +     'cookiecutter': OrderedDict({
E         -     'run_as_docker': True,
E         +         'run_as_docker': True,
E         ? ++++
E         +     }),
E           }

tests/test_prompt.py:554: AssertionError
_______ test_undefined_variable[Undefined variable in cookiecutter dict] _______

context = {'cookiecutter': {'foo': '{{cookiecutter.nope}}'}}

    @pytest.mark.parametrize(
        'context',
        (
            {'cookiecutter': {'foo': '{{cookiecutter.nope}}'}},
            {'cookiecutter': {'foo': ['123', '{{cookiecutter.nope}}', '456']}},
            {'cookiecutter': {'foo': {'{{cookiecutter.nope}}': 'value'}}},
            {'cookiecutter': {'foo': {'key': '{{cookiecutter.nope}}'}}},
        ),
        ids=[
            'Undefined variable in cookiecutter dict',
            'Undefined variable in cookiecutter dict with choices',
            'Undefined variable in cookiecutter dict with dict_key',
            'Undefined variable in cookiecutter dict with key_value',
        ],
    )
    def test_undefined_variable(context):
        """Verify `prompt.prompt_for_config` raises correct error."""
>       with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UndefinedVariableInTemplate'>

tests/test_prompt.py:574: Failed
_ test_undefined_variable[Undefined variable in cookiecutter dict with choices] _

context = {'cookiecutter': {'foo': ['123', '{{cookiecutter.nope}}', '456']}}

    @pytest.mark.parametrize(
        'context',
        (
            {'cookiecutter': {'foo': '{{cookiecutter.nope}}'}},
            {'cookiecutter': {'foo': ['123', '{{cookiecutter.nope}}', '456']}},
            {'cookiecutter': {'foo': {'{{cookiecutter.nope}}': 'value'}}},
            {'cookiecutter': {'foo': {'key': '{{cookiecutter.nope}}'}}},
        ),
        ids=[
            'Undefined variable in cookiecutter dict',
            'Undefined variable in cookiecutter dict with choices',
            'Undefined variable in cookiecutter dict with dict_key',
            'Undefined variable in cookiecutter dict with key_value',
        ],
    )
    def test_undefined_variable(context):
        """Verify `prompt.prompt_for_config` raises correct error."""
>       with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UndefinedVariableInTemplate'>

tests/test_prompt.py:574: Failed
_ test_undefined_variable[Undefined variable in cookiecutter dict with dict_key] _

context = {'cookiecutter': {'foo': {'{{cookiecutter.nope}}': 'value'}}}

    @pytest.mark.parametrize(
        'context',
        (
            {'cookiecutter': {'foo': '{{cookiecutter.nope}}'}},
            {'cookiecutter': {'foo': ['123', '{{cookiecutter.nope}}', '456']}},
            {'cookiecutter': {'foo': {'{{cookiecutter.nope}}': 'value'}}},
            {'cookiecutter': {'foo': {'key': '{{cookiecutter.nope}}'}}},
        ),
        ids=[
            'Undefined variable in cookiecutter dict',
            'Undefined variable in cookiecutter dict with choices',
            'Undefined variable in cookiecutter dict with dict_key',
            'Undefined variable in cookiecutter dict with key_value',
        ],
    )
    def test_undefined_variable(context):
        """Verify `prompt.prompt_for_config` raises correct error."""
>       with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UndefinedVariableInTemplate'>

tests/test_prompt.py:574: Failed
_ test_undefined_variable[Undefined variable in cookiecutter dict with key_value] _

context = {'cookiecutter': {'foo': {'key': '{{cookiecutter.nope}}'}}}

    @pytest.mark.parametrize(
        'context',
        (
            {'cookiecutter': {'foo': '{{cookiecutter.nope}}'}},
            {'cookiecutter': {'foo': ['123', '{{cookiecutter.nope}}', '456']}},
            {'cookiecutter': {'foo': {'{{cookiecutter.nope}}': 'value'}}},
            {'cookiecutter': {'foo': {'key': '{{cookiecutter.nope}}'}}},
        ),
        ids=[
            'Undefined variable in cookiecutter dict',
            'Undefined variable in cookiecutter dict with choices',
            'Undefined variable in cookiecutter dict with dict_key',
            'Undefined variable in cookiecutter dict with key_value',
        ],
    )
    def test_undefined_variable(context):
        """Verify `prompt.prompt_for_config` raises correct error."""
>       with pytest.raises(exceptions.UndefinedVariableInTemplate) as err:
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UndefinedVariableInTemplate'>

tests/test_prompt.py:574: Failed
____ test_cookiecutter_nested_templates[fake-nested-templates-fake-project] ____

template_dir = 'fake-nested-templates'
expected = PosixPath('/workspace/cookiecutter/tests/fake-nested-templates/fake-project')

    @pytest.mark.parametrize(
        "template_dir,expected",
        [
            ["fake-nested-templates", "fake-project"],
            ["fake-nested-templates-old-style", "fake-package"],
        ],
    )
    def test_cookiecutter_nested_templates(template_dir: str, expected: str):
        """Test nested_templates generation."""
        from cookiecutter import prompt
    
        main_dir = (Path("tests") / template_dir).resolve()
        cookiecuter_context = json.loads((main_dir / "cookiecutter.json").read_text())
        context = {"cookiecutter": cookiecuter_context}
        output_dir = prompt.choose_nested_template(context, main_dir, no_input=True)
        expected = (Path(main_dir) / expected).resolve()
>       assert output_dir == f"{expected}"
E       AssertionError: assert None == '/workspace/cookiecutter/tests/fake-nested-templates/fake-project'

tests/test_prompt.py:598: AssertionError
_ test_cookiecutter_nested_templates[fake-nested-templates-old-style-fake-package] _

template_dir = 'fake-nested-templates-old-style'
expected = PosixPath('/workspace/cookiecutter/tests/fake-nested-templates-old-style/fake-package')

    @pytest.mark.parametrize(
        "template_dir,expected",
        [
            ["fake-nested-templates", "fake-project"],
            ["fake-nested-templates-old-style", "fake-package"],
        ],
    )
    def test_cookiecutter_nested_templates(template_dir: str, expected: str):
        """Test nested_templates generation."""
        from cookiecutter import prompt
    
        main_dir = (Path("tests") / template_dir).resolve()
        cookiecuter_context = json.loads((main_dir / "cookiecutter.json").read_text())
        context = {"cookiecutter": cookiecuter_context}
        output_dir = prompt.choose_nested_template(context, main_dir, no_input=True)
        expected = (Path(main_dir) / expected).resolve()
>       assert output_dir == f"{expected}"
E       AssertionError: assert None == '/workspace/cookiecutter/tests/fake-nested-templates-old-style/fake-package'

tests/test_prompt.py:598: AssertionError
______________ test_cookiecutter_nested_templates_invalid_paths[] ______________

path = ''

    @pytest.mark.skipif(sys.platform.startswith('win'), reason="Linux / macos test")
    @pytest.mark.parametrize(
        "path",
        [
            "",
            "/tmp",
            "/foo",
        ],
    )
    def test_cookiecutter_nested_templates_invalid_paths(path: str):
        """Test nested_templates generation."""
        from cookiecutter import prompt
    
        main_dir = (Path("tests") / "fake-nested-templates").resolve()
        cookiecuter_context = json.loads((main_dir / "cookiecutter.json").read_text())
        cookiecuter_context["templates"]["fake-project"]["path"] = path
        context = {"cookiecutter": cookiecuter_context}
>       with pytest.raises(ValueError) as exc:
E       Failed: DID NOT RAISE <class 'ValueError'>

tests/test_prompt.py:618: Failed
____________ test_cookiecutter_nested_templates_invalid_paths[/tmp] ____________

path = '/tmp'

    @pytest.mark.skipif(sys.platform.startswith('win'), reason="Linux / macos test")
    @pytest.mark.parametrize(
        "path",
        [
            "",
            "/tmp",
            "/foo",
        ],
    )
    def test_cookiecutter_nested_templates_invalid_paths(path: str):
        """Test nested_templates generation."""
        from cookiecutter import prompt
    
        main_dir = (Path("tests") / "fake-nested-templates").resolve()
        cookiecuter_context = json.loads((main_dir / "cookiecutter.json").read_text())
        cookiecuter_context["templates"]["fake-project"]["path"] = path
        context = {"cookiecutter": cookiecuter_context}
>       with pytest.raises(ValueError) as exc:
E       Failed: DID NOT RAISE <class 'ValueError'>

tests/test_prompt.py:618: Failed
____________ test_cookiecutter_nested_templates_invalid_paths[/foo] ____________

path = '/foo'

    @pytest.mark.skipif(sys.platform.startswith('win'), reason="Linux / macos test")
    @pytest.mark.parametrize(
        "path",
        [
            "",
            "/tmp",
            "/foo",
        ],
    )
    def test_cookiecutter_nested_templates_invalid_paths(path: str):
        """Test nested_templates generation."""
        from cookiecutter import prompt
    
        main_dir = (Path("tests") / "fake-nested-templates").resolve()
        cookiecuter_context = json.loads((main_dir / "cookiecutter.json").read_text())
        cookiecuter_context["templates"]["fake-project"]["path"] = path
        context = {"cookiecutter": cookiecuter_context}
>       with pytest.raises(ValueError) as exc:
E       Failed: DID NOT RAISE <class 'ValueError'>

tests/test_prompt.py:618: Failed
____________________ test_prompt_should_ask_and_rm_repo_dir ____________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e2ad40>
tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_ask_and_rm_0')

    def test_prompt_should_ask_and_rm_repo_dir(mocker, tmp_path):
        """In `prompt_and_delete()`, if the user agrees to delete/reclone the \
        repo, the repo should be deleted."""
        mock_read_user = mocker.patch(
            'cookiecutter.prompt.read_user_yes_no', return_value=True
        )
        repo_dir = Path(tmp_path, 'repo')
        repo_dir.mkdir()
    
        deleted = prompt.prompt_and_delete(str(repo_dir))
    
>       assert mock_read_user.called
E       AssertionError: assert False
E        +  where False = <MagicMock name='read_user_yes_no' id='136935400181856'>.called

tests/test_prompt.py:656: AssertionError
______________ test_prompt_should_ask_and_exit_on_user_no_answer _______________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac27fc310>
tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_ask_and_exi0')

    def test_prompt_should_ask_and_exit_on_user_no_answer(mocker, tmp_path):
        """In `prompt_and_delete()`, if the user decline to delete/reclone the \
        repo, cookiecutter should exit."""
        mock_read_user = mocker.patch(
            'cookiecutter.prompt.read_user_yes_no',
            return_value=False,
        )
        mock_sys_exit = mocker.patch('sys.exit', return_value=True)
        repo_dir = Path(tmp_path, 'repo')
        repo_dir.mkdir()
    
        deleted = prompt.prompt_and_delete(str(repo_dir))
    
>       assert mock_read_user.called
E       AssertionError: assert False
E        +  where False = <MagicMock name='read_user_yes_no' id='136935410483552'>.called

tests/test_prompt.py:674: AssertionError
___________________ test_prompt_should_ask_and_rm_repo_file ____________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac16bde70>
tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_ask_and_rm_1')

    def test_prompt_should_ask_and_rm_repo_file(mocker, tmp_path):
        """In `prompt_and_delete()`, if the user agrees to delete/reclone a \
        repo file, the repo should be deleted."""
        mock_read_user = mocker.patch(
            'cookiecutter.prompt.read_user_yes_no', return_value=True, autospec=True
        )
    
        repo_file = tmp_path.joinpath('repo.zip')
        repo_file.write_text('this is zipfile content')
    
        deleted = prompt.prompt_and_delete(str(repo_file))
    
>       assert mock_read_user.called
E       assert False
E        +  where False = <function read_user_yes_no at 0x7c8ac1463a30>.called

tests/test_prompt.py:692: AssertionError
_______________ test_prompt_should_ask_and_keep_repo_on_no_reuse _______________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1456ad0>
tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_ask_and_kee0')

    def test_prompt_should_ask_and_keep_repo_on_no_reuse(mocker, tmp_path):
        """In `prompt_and_delete()`, if the user wants to keep their old \
        cloned template repo, it should not be deleted."""
        mock_read_user = mocker.patch(
            'cookiecutter.prompt.read_user_yes_no', return_value=False, autospec=True
        )
        repo_dir = Path(tmp_path, 'repo')
        repo_dir.mkdir()
    
>       with pytest.raises(SystemExit):
E       Failed: DID NOT RAISE <class 'SystemExit'>

tests/test_prompt.py:706: Failed
________________ test_prompt_should_ask_and_keep_repo_on_reuse _________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e030d0>
tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_ask_and_kee1')

    def test_prompt_should_ask_and_keep_repo_on_reuse(mocker, tmp_path):
        """In `prompt_and_delete()`, if the user wants to keep their old \
        cloned template repo, it should not be deleted."""
    
        def answer(question, default):
            return 'okay to delete' not in question
    
        mock_read_user = mocker.patch(
            'cookiecutter.prompt.read_user_yes_no', side_effect=answer, autospec=True
        )
        repo_dir = Path(tmp_path, 'repo')
        repo_dir.mkdir()
    
        deleted = prompt.prompt_and_delete(str(repo_dir))
    
>       assert mock_read_user.called
E       assert False
E        +  where False = <function read_user_yes_no at 0x7c8ac1463d90>.called

tests/test_prompt.py:728: AssertionError
____________ test_prompt_should_not_ask_if_no_input_and_rm_repo_dir ____________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e15e40>
tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_not_ask_if_0')

    def test_prompt_should_not_ask_if_no_input_and_rm_repo_dir(mocker, tmp_path):
        """Prompt should not ask if no input and rm dir.
    
        In `prompt_and_delete()`, if `no_input` is True, the call to
        `prompt.read_user_yes_no()` should be suppressed.
        """
        mock_read_user = mocker.patch(
            'cookiecutter.prompt.read_user_yes_no', return_value=True, autospec=True
        )
        repo_dir = Path(tmp_path, 'repo')
        repo_dir.mkdir()
    
        deleted = prompt.prompt_and_delete(str(repo_dir), no_input=True)
    
        assert not mock_read_user.called
>       assert not repo_dir.exists()
E       AssertionError: assert not True
E        +  where True = exists()
E        +    where exists = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_not_ask_if_0/repo').exists

tests/test_prompt.py:748: AssertionError
___________ test_prompt_should_not_ask_if_no_input_and_rm_repo_file ____________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac16bfeb0>
tmp_path = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_not_ask_if_1')

    def test_prompt_should_not_ask_if_no_input_and_rm_repo_file(mocker, tmp_path):
        """Prompt should not ask if no input and rm file.
    
        In `prompt_and_delete()`, if `no_input` is True, the call to
        `prompt.read_user_yes_no()` should be suppressed.
        """
        mock_read_user = mocker.patch(
            'cookiecutter.prompt.read_user_yes_no', return_value=True, autospec=True
        )
    
        repo_file = tmp_path.joinpath('repo.zip')
        repo_file.write_text('this is zipfile content')
    
        deleted = prompt.prompt_and_delete(str(repo_file), no_input=True)
    
        assert not mock_read_user.called
>       assert not repo_file.exists()
E       AssertionError: assert not True
E        +  where True = exists()
E        +    where exists = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_not_ask_if_1/repo.zip').exists

tests/test_prompt.py:768: AssertionError
________________________ test_click_invocation[1-hello] ________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1537c40>
user_choice = 1, expected_value = 'hello'

    @pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTIONS, 1))
    def test_click_invocation(mocker, user_choice, expected_value):
        """Test click function called correctly by cookiecutter.
    
        Test for choice type invocation.
        """
        prompt = mocker.patch('rich.prompt.Prompt.ask')
        prompt.return_value = f'{user_choice}'
    
>       assert read_user_choice('varname', OPTIONS) == expected_value
E       AssertionError: assert '1' == 'hello'
E         
E         - hello
E         + 1

tests/test_read_user_choice.py:27: AssertionError
________________________ test_click_invocation[2-world] ________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1535ae0>
user_choice = 2, expected_value = 'world'

    @pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTIONS, 1))
    def test_click_invocation(mocker, user_choice, expected_value):
        """Test click function called correctly by cookiecutter.
    
        Test for choice type invocation.
        """
        prompt = mocker.patch('rich.prompt.Prompt.ask')
        prompt.return_value = f'{user_choice}'
    
>       assert read_user_choice('varname', OPTIONS) == expected_value
E       AssertionError: assert '2' == 'world'
E         
E         - world
E         + 2

tests/test_read_user_choice.py:27: AssertionError
_________________________ test_click_invocation[3-foo] _________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac18876d0>
user_choice = 3, expected_value = 'foo'

    @pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTIONS, 1))
    def test_click_invocation(mocker, user_choice, expected_value):
        """Test click function called correctly by cookiecutter.
    
        Test for choice type invocation.
        """
        prompt = mocker.patch('rich.prompt.Prompt.ask')
        prompt.return_value = f'{user_choice}'
    
>       assert read_user_choice('varname', OPTIONS) == expected_value
E       AssertionError: assert '3' == 'foo'
E         
E         - foo
E         + 3

tests/test_read_user_choice.py:27: AssertionError
_________________________ test_click_invocation[4-bar] _________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1434370>
user_choice = 4, expected_value = 'bar'

    @pytest.mark.parametrize('user_choice, expected_value', enumerate(OPTIONS, 1))
    def test_click_invocation(mocker, user_choice, expected_value):
        """Test click function called correctly by cookiecutter.
    
        Test for choice type invocation.
        """
        prompt = mocker.patch('rich.prompt.Prompt.ask')
        prompt.return_value = f'{user_choice}'
    
>       assert read_user_choice('varname', OPTIONS) == expected_value
E       AssertionError: assert '4' == 'bar'
E         
E         - bar
E         + 4

tests/test_read_user_choice.py:27: AssertionError
________________ test_raise_if_options_is_not_a_non_empty_list _________________

    def test_raise_if_options_is_not_a_non_empty_list():
        """Test function called by cookiecutter raise expected errors.
    
        Test for choice type invocation.
        """
        with pytest.raises(TypeError):
>           read_user_choice('foo', 'NOT A LIST')

tests/test_read_user_choice.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/prompt.py:70: in read_user_choice
    return Prompt.ask(prompt_text, choices=options, default=options[0])
/home/openhands/.local/lib/python3.10/site-packages/rich/prompt.py:149: in ask
    return _prompt(default=default, stream=stream)
/home/openhands/.local/lib/python3.10/site-packages/rich/prompt.py:292: in __call__
    value = self.get_input(self.console, prompt, self.password, stream=stream)
/home/openhands/.local/lib/python3.10/site-packages/rich/prompt.py:211: in get_input
    return console.input(prompt, password=password, stream=stream)
/home/openhands/.local/lib/python3.10/site-packages/rich/console.py:2174: in input
    result = input()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_pytest.capture.DontReadFromInput object at 0x7c8ac3a35f00>, size = -1

    def read(self, size: int = -1) -> str:
>       raise OSError(
            "pytest: reading from stdin while output is captured!  Consider using `-s`."
        )
E       OSError: pytest: reading from stdin while output is captured!  Consider using `-s`.

/home/openhands/.local/lib/python3.10/site-packages/_pytest/capture.py:229: OSError
----------------------------- Captured stdout call -----------------------------
foo [N/O/T/ /A/ /L/I/S/T] (N): 
________________________ test_process_json_invalid_json ________________________

    def test_process_json_invalid_json():
        """Test `process_json` for correct error on malformed input."""
>       with pytest.raises(InvalidResponse) as exc_info:
E       Failed: DID NOT RAISE <class 'rich.prompt.InvalidResponse'>

tests/test_read_user_dict.py:12: Failed
__________________________ test_process_json_non_dict __________________________

    def test_process_json_non_dict():
        """Test `process_json` for correct error on non-JSON input."""
>       with pytest.raises(InvalidResponse) as exc_info:
E       Failed: DID NOT RAISE <class 'rich.prompt.InvalidResponse'>

tests/test_read_user_dict.py:20: Failed
_________________________ test_should_raise_type_error _________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e288e0>

    def test_should_raise_type_error(mocker):
        """Test `default_value` arg verification in `read_user_dict` function."""
        prompt = mocker.patch('cookiecutter.prompt.JsonPrompt.ask')
    
>       with pytest.raises(TypeError):
E       Failed: DID NOT RAISE <class 'TypeError'>

tests/test_read_user_dict.py:79: Failed
__________________ test_should_call_prompt_with_process_json ___________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e8f730>

    def test_should_call_prompt_with_process_json(mocker):
        """Test to make sure that `process_json` is actually being used.
    
        Verifies generation of a processor for the user input.
        """
        mock_prompt = mocker.patch('cookiecutter.prompt.JsonPrompt.ask', autospec=True)
    
        read_user_dict('name', {'project_slug': 'pytest-plugin'})
        print(mock_prompt.call_args)
        args, kwargs = mock_prompt.call_args
    
>       assert args == ('name [cyan bold](default)[/]',)
E       AssertionError: assert ('name',) == ('name [cyan bold](default)[/]',)
E         
E         At index 0 diff: 'name' != 'name [cyan bold](default)[/]'
E         
E         Full diff:
E           (
E         -     'name [cyan bold](default)[/]',
E         +     'name',
E           )

tests/test_read_user_dict.py:95: AssertionError
----------------------------- Captured stdout call -----------------------------
call('name', default={'project_slug': 'pytest-plugin'})
___________________ test_input_loop_with_null_default_value ____________________

mock_prompt = <MagicMock name='ask' id='136935400029488'>

    def test_input_loop_with_null_default_value(mock_prompt):
        """Test `Prompt.ask` is run repeatedly until a valid answer is provided.
    
        Test for `default_value` parameter equal to None.
        """
        # Simulate user providing None input initially and then a valid input
        mock_prompt.side_effect = [None, DEFAULT]
    
>       assert read_user_variable(VARIABLE, None) == DEFAULT
E       AssertionError: assert None == 'Kivy Project'
E        +  where None = read_user_variable('project_name', None)

tests/test_read_user_variable.py:37: AssertionError
_____________________________ test_api_invocation ______________________________

self = <MagicMock name='generate_files' id='136935394269968'>, args = ()
kwargs = {'accept_hooks': True, 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'keep_project_on_failure': False, 'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', ...}
expected = call(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', accept_hooks=True, keep_project_on_failure=False)
actual = call(repo_dir=PosixPath('/tmp/tmp64dbz47s'), context=<MagicMock name='prompt_for_config()' id='136935391096368'>, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7c8ac13c03a0>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: generate_files(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', accept_hooks=True, keep_project_on_failure=False)
E           Actual: generate_files(repo_dir=PosixPath('/tmp/tmp64dbz47s'), context=<MagicMock name='prompt_for_config()' id='136935391096368'>, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)

/usr/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

self = <MagicMock name='generate_files' id='136935394269968'>, args = ()
kwargs = {'accept_hooks': True, 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'keep_project_on_failure': False, 'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', ...}

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
>       return self.assert_called_with(*args, **kwargs)
E       AssertionError: expected call not found.
E       Expected: generate_files(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', accept_hooks=True, keep_project_on_failure=False)
E       Actual: generate_files(repo_dir=PosixPath('/tmp/tmp64dbz47s'), context=<MagicMock name='prompt_for_config()' id='136935391096368'>, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       
E       pytest introspection follows:
E       
E       Kwargs:
E       assert {'repo_dir': PosixPath('/tmp/tmp64dbz47s'), 'context': <MagicMock name='prompt_for_config()' id='136935391096368'>, 'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False} == {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template', 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output',
E          'overwrite_if_exists': False,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'context': <MagicMock name='prompt_for_config()' id='136935391096368'>} != {'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}}
E         {'repo_dir': PosixPath('/tmp/tmp64dbz47s')} != {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template'}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'context': <MagicMock name='prompt_for_config()' id='136935391096368'>,
E         -     'context': {
E         -         'cookiecutter': {
E         -             'email': 'raphael@hackebrot.de',
E         -             'full_name': 'Raphael Pierzina',
E         -             'github_username': 'hackebrot',
E         -             'version': '0.1.0',
E         -         },
E         -     },
E               'keep_project_on_failure': False,
E               'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output',
E               'overwrite_if_exists': False,
E         -     'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template',
E         +     'repo_dir': PosixPath('/tmp/tmp64dbz47s'),
E               'skip_if_file_exists': False,
E           }

/usr/lib/python3.10/unittest/mock.py:941: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1dff790>
template = '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output'
context = {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}

    def test_api_invocation(mocker, template, output_dir, context):
        """Verify output dir location is correctly passed."""
        mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
    
        main.cookiecutter(template, output_dir=output_dir)
    
>       mock_gen_files.assert_called_once_with(
            repo_dir=template,
            context=context,
            overwrite_if_exists=False,
            skip_if_file_exists=False,
            output_dir=output_dir,
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: expected call not found.
E       Expected: generate_files(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', accept_hooks=True, keep_project_on_failure=False)
E       Actual: generate_files(repo_dir=PosixPath('/tmp/tmp64dbz47s'), context=<MagicMock name='prompt_for_config()' id='136935391096368'>, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       
E       pytest introspection follows:
E       
E       Kwargs:
E       assert {'repo_dir': PosixPath('/tmp/tmp64dbz47s'), 'context': <MagicMock name='prompt_for_config()' id='136935391096368'>, 'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False} == {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template', 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output',
E          'overwrite_if_exists': False,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'context': <MagicMock name='prompt_for_config()' id='136935391096368'>} != {'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}}
E         {'repo_dir': PosixPath('/tmp/tmp64dbz47s')} != {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template'}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'context': <MagicMock name='prompt_for_config()' id='136935391096368'>,
E         -     'context': {
E         -         'cookiecutter': {
E         -             'email': 'raphael@hackebrot.de',
E         -             'full_name': 'Raphael Pierzina',
E         -             'github_username': 'hackebrot',
E         -             'version': '0.1.0',
E         -         },
E         -     },
E               'keep_project_on_failure': False,
E               'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output',
E               'overwrite_if_exists': False,
E         -     'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template',
E         +     'repo_dir': PosixPath('/tmp/tmp64dbz47s'),
E               'skip_if_file_exists': False,
E           }

tests/test_specify_output_dir.py:54: AssertionError
___________________________ test_default_output_dir ____________________________

self = <MagicMock name='generate_files' id='136935389606432'>, args = ()
kwargs = {'accept_hooks': True, 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'keep_project_on_failure': False, 'output_dir': '.', ...}
expected = call(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', accept_hooks=True, keep_project_on_failure=False)
actual = call(repo_dir=PosixPath('/tmp/tmpprfecdj1'), context=<MagicMock name='prompt_for_config()' id='136935390092624'>, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7c8ac14611b0>
cause = None

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.
    
        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)
    
        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher(_Call((args, kwargs), two=True))
        actual = self._call_matcher(self.call_args)
        if actual != expected:
            cause = expected if isinstance(expected, Exception) else None
>           raise AssertionError(_error_message()) from cause
E           AssertionError: expected call not found.
E           Expected: generate_files(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', accept_hooks=True, keep_project_on_failure=False)
E           Actual: generate_files(repo_dir=PosixPath('/tmp/tmpprfecdj1'), context=<MagicMock name='prompt_for_config()' id='136935390092624'>, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)

/usr/lib/python3.10/unittest/mock.py:929: AssertionError

During handling of the above exception, another exception occurred:

self = <MagicMock name='generate_files' id='136935389606432'>, args = ()
kwargs = {'accept_hooks': True, 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'keep_project_on_failure': False, 'output_dir': '.', ...}

    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
>       return self.assert_called_with(*args, **kwargs)
E       AssertionError: expected call not found.
E       Expected: generate_files(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', accept_hooks=True, keep_project_on_failure=False)
E       Actual: generate_files(repo_dir=PosixPath('/tmp/tmpprfecdj1'), context=<MagicMock name='prompt_for_config()' id='136935390092624'>, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       
E       pytest introspection follows:
E       
E       Kwargs:
E       assert {'repo_dir': PosixPath('/tmp/tmpprfecdj1'), 'context': <MagicMock name='prompt_for_config()' id='136935390092624'>, 'output_dir': '.', 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False} == {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template', 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '.', 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'context': <MagicMock name='prompt_for_config()' id='136935390092624'>} != {'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}}
E         {'repo_dir': PosixPath('/tmp/tmpprfecdj1')} != {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template'}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'context': <MagicMock name='prompt_for_config()' id='136935390092624'>,
E         -     'context': {
E         -         'cookiecutter': {
E         -             'email': 'raphael@hackebrot.de',
E         -             'full_name': 'Raphael Pierzina',
E         -             'github_username': 'hackebrot',
E         -             'version': '0.1.0',
E         -         },
E         -     },
E               'keep_project_on_failure': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E         -     'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template',
E         +     'repo_dir': PosixPath('/tmp/tmpprfecdj1'),
E               'skip_if_file_exists': False,
E           }

/usr/lib/python3.10/unittest/mock.py:941: AssertionError

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1412bc0>
template = '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template'
context = {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}

    def test_default_output_dir(mocker, template, context):
        """Verify default output dir is current working folder."""
        mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
    
        main.cookiecutter(template)
    
>       mock_gen_files.assert_called_once_with(
            repo_dir=template,
            context=context,
            overwrite_if_exists=False,
            skip_if_file_exists=False,
            output_dir='.',
            accept_hooks=True,
            keep_project_on_failure=False,
        )
E       AssertionError: expected call not found.
E       Expected: generate_files(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', accept_hooks=True, keep_project_on_failure=False)
E       Actual: generate_files(repo_dir=PosixPath('/tmp/tmpprfecdj1'), context=<MagicMock name='prompt_for_config()' id='136935390092624'>, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       
E       pytest introspection follows:
E       
E       Kwargs:
E       assert {'repo_dir': PosixPath('/tmp/tmpprfecdj1'), 'context': <MagicMock name='prompt_for_config()' id='136935390092624'>, 'output_dir': '.', 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False} == {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template', 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '.', 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'context': <MagicMock name='prompt_for_config()' id='136935390092624'>} != {'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}}
E         {'repo_dir': PosixPath('/tmp/tmpprfecdj1')} != {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template'}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'context': <MagicMock name='prompt_for_config()' id='136935390092624'>,
E         -     'context': {
E         -         'cookiecutter': {
E         -             'email': 'raphael@hackebrot.de',
E         -             'full_name': 'Raphael Pierzina',
E         -             'github_username': 'hackebrot',
E         -             'version': '0.1.0',
E         -         },
E         -     },
E               'keep_project_on_failure': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E         -     'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template',
E         +     'repo_dir': PosixPath('/tmp/tmpprfecdj1'),
E               'skip_if_file_exists': False,
E           }

tests/test_specify_output_dir.py:71: AssertionError
________________________ test_build_templates[include] _________________________

template = 'include'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_build_templates_include_0/templates'

    @pytest.mark.parametrize("template", ["include", "no-templates", "extends", "super"])
    def test_build_templates(template, output_dir):
        """
        Verify Templates Design keywords.
    
        no-templates is a compatibility tests for repo without `templates` directory
        """
>       project_dir = main.cookiecutter(
            f'tests/test-templates/{template}',
            no_input=True,
            output_dir=output_dir,
        )

tests/test_templates.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:268: in generate_files
    generate_file(
cookiecutter/generate.py:157: in generate_file
    rendered_file = tmpl.render(**context)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   TypeError: no loader for this environment specified

<template>:3: TypeError
________________________ test_build_templates[extends] _________________________

template = 'extends'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_build_templates_extends_0/templates'

    @pytest.mark.parametrize("template", ["include", "no-templates", "extends", "super"])
    def test_build_templates(template, output_dir):
        """
        Verify Templates Design keywords.
    
        no-templates is a compatibility tests for repo without `templates` directory
        """
>       project_dir = main.cookiecutter(
            f'tests/test-templates/{template}',
            no_input=True,
            output_dir=output_dir,
        )

tests/test_templates.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:268: in generate_files
    generate_file(
cookiecutter/generate.py:157: in generate_file
    rendered_file = tmpl.render(**context)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   TypeError: no loader for this environment specified

<template>:1: TypeError
_________________________ test_build_templates[super] __________________________

template = 'super'
output_dir = '/tmp/pytest-of-openhands/pytest-30/test_build_templates_super_0/templates'

    @pytest.mark.parametrize("template", ["include", "no-templates", "extends", "super"])
    def test_build_templates(template, output_dir):
        """
        Verify Templates Design keywords.
    
        no-templates is a compatibility tests for repo without `templates` directory
        """
>       project_dir = main.cookiecutter(
            f'tests/test-templates/{template}',
            no_input=True,
            output_dir=output_dir,
        )

tests/test_templates.py:28: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/main.py:100: in cookiecutter
    result = generate_files(
cookiecutter/generate.py:268: in generate_files
    generate_file(
cookiecutter/generate.py:157: in generate_file
    rendered_file = tmpl.render(**context)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1295: in render
    self.environment.handle_exception()
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   TypeError: no loader for this environment specified

<template>:1: TypeError
_______________________ test_utc_default_datetime_format _______________________

environment = <jinja2.environment.Environment object at 0x7c8ac1e558a0>

    def test_utc_default_datetime_format(environment):
        """Verify default datetime format can be parsed."""
>       template = environment.from_string("{% now 'utc' %}")

tests/test_time_extension.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:1: TemplateSyntaxError
_______________________ test_accept_valid_timezones[utc] _______________________

environment = <jinja2.environment.Environment object at 0x7c8ac1dc0be0>
valid_tz = 'utc'

    @pytest.mark.parametrize("valid_tz", ['utc', 'local', 'Europe/Berlin'])
    def test_accept_valid_timezones(environment, valid_tz):
        """Verify that valid timezones are accepted."""
>       template = environment.from_string(f"{{% now '{valid_tz}', '%Y-%m' %}}")

tests/test_time_extension.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:1: TemplateSyntaxError
______________________ test_accept_valid_timezones[local] ______________________

environment = <jinja2.environment.Environment object at 0x7c8ac1e5d9c0>
valid_tz = 'local'

    @pytest.mark.parametrize("valid_tz", ['utc', 'local', 'Europe/Berlin'])
    def test_accept_valid_timezones(environment, valid_tz):
        """Verify that valid timezones are accepted."""
>       template = environment.from_string(f"{{% now '{valid_tz}', '%Y-%m' %}}")

tests/test_time_extension.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:1: TemplateSyntaxError
__________________ test_accept_valid_timezones[Europe/Berlin] __________________

environment = <jinja2.environment.Environment object at 0x7c8ac1de8520>
valid_tz = 'Europe/Berlin'

    @pytest.mark.parametrize("valid_tz", ['utc', 'local', 'Europe/Berlin'])
    def test_accept_valid_timezones(environment, valid_tz):
        """Verify that valid timezones are accepted."""
>       template = environment.from_string(f"{{% now '{valid_tz}', '%Y-%m' %}}")

tests/test_time_extension.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:1: TemplateSyntaxError
_______________________ test_environment_datetime_format _______________________

environment = <jinja2.environment.Environment object at 0x7c8ac1085660>

    def test_environment_datetime_format(environment):
        """Verify datetime format can be parsed from environment."""
        environment.datetime_format = '%a, %d %b %Y %H:%M:%S'
    
>       template = environment.from_string("{% now 'utc' %}")

tests/test_time_extension.py:48: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:1: TemplateSyntaxError
________________________________ test_add_time _________________________________

environment = <jinja2.environment.Environment object at 0x7c8ac13ff700>

    def test_add_time(environment):
        """Verify that added time offset can be parsed."""
        environment.datetime_format = '%a, %d %b %Y %H:%M:%S'
    
>       template = environment.from_string("{% now 'utc' + 'hours=2,seconds=30' %}")

tests/test_time_extension.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:1: TemplateSyntaxError
_____________________________ test_substract_time ______________________________

environment = <jinja2.environment.Environment object at 0x7c8ac172aad0>

    def test_substract_time(environment):
        """Verify that substracted time offset can be parsed."""
        environment.datetime_format = '%a, %d %b %Y %H:%M:%S'
    
>       template = environment.from_string("{% now 'utc' - 'minutes=11' %}")

tests/test_time_extension.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:1: TemplateSyntaxError
___________________________ test_offset_with_format ____________________________

environment = <jinja2.environment.Environment object at 0x7c8ac175c550>

    def test_offset_with_format(environment):
        """Verify that offset works together with datetime format."""
        environment.datetime_format = '%d %b %Y %H:%M:%S'
    
>       template = environment.from_string(
            "{% now 'utc' - 'days=2,minutes=33,seconds=1', '%d %b %Y %H:%M:%S' %}"
        )

tests/test_time_extension.py:75: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:1111: in from_string
    return cls.from_code(self, self.compile(source), gs, None)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:771: in compile
    self.handle_exception(source=source_hint)
/home/openhands/.local/lib/python3.10/site-packages/jinja2/environment.py:942: in handle_exception
    raise rewrite_traceback_stack(source=source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'

<unknown>:1: TemplateSyntaxError
_____________ test_clone_should_rstrip_trailing_slash_in_repo_url ______________

repo_url = 'https://github.com/foo/bar/', checkout = None
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_rstrip_trail0/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
>           subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

cookiecutter/vcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (['git', 'clone', 'https://github.com/foo/bar/', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_rstrip_trail0/clone_dir'],)
kwargs = {'stderr': -1, 'stdout': -1}
process = <Popen: returncode: 128 args: ['git', 'clone', 'https://github.com/foo/bar/'...>
stdout = b''
stderr = b"Cloning into '/tmp/pytest-of-openhands/pytest-30/test_clone_should_rstrip_trail0/clone_dir'...\nfatal: could not read Username for 'https://github.com': No such device or address\n"
retcode = 128

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/foo/bar/', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_rstrip_trail0/clone_dir']' returned non-zero exit status 128.

/usr/lib/python3.10/subprocess.py:526: CalledProcessError

The above exception was the direct cause of the following exception:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1084970>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_rstrip_trail0/clone_dir')

    def test_clone_should_rstrip_trailing_slash_in_repo_url(mocker, clone_dir):
        """In `clone()`, repo URL's trailing slash should be stripped if one is \
        present."""
        mocker.patch('cookiecutter.vcs.is_vcs_installed', autospec=True, return_value=True)
    
        mock_subprocess = mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
        )
    
>       vcs.clone('https://github.com/foo/bar/', clone_to_dir=clone_dir, no_input=True)

tests/vcs/test_clone.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'https://github.com/foo/bar/', checkout = None
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_rstrip_trail0/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
            subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except subprocess.CalledProcessError as e:
>           raise RepositoryCloneFailed(f'Failed to clone repository: {e}') from e
E           cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'https://github.com/foo/bar/', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_rstrip_trail0/clone_dir']' returned non-zero exit status 128.

cookiecutter/vcs.py:71: RepositoryCloneFailed
___________ test_clone_should_abort_if_user_does_not_want_to_reclone ___________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac157fdf0>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_abort_if_use0/clone_dir')

    def test_clone_should_abort_if_user_does_not_want_to_reclone(mocker, clone_dir):
        """In `clone()`, if user doesn't want to reclone, Cookiecutter should exit \
        without cloning anything."""
        mocker.patch('cookiecutter.vcs.is_vcs_installed', autospec=True, return_value=True)
        mocker.patch(
            'cookiecutter.vcs.prompt_and_delete', side_effect=SystemExit, autospec=True
        )
        mock_subprocess = mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
        )
    
        # Create repo_dir to trigger prompt_and_delete
        repo_dir = clone_dir.joinpath('cookiecutter-pytest-plugin')
        repo_dir.mkdir()
    
        repo_url = 'https://github.com/pytest-dev/cookiecutter-pytest-plugin.git'
    
>       with pytest.raises(SystemExit):
E       Failed: DID NOT RAISE <class 'SystemExit'>

tests/vcs/test_clone.py:59: Failed
_ test_clone_should_invoke_vcs_command[git-https://github.com/hello/world.git-world] _

repo_url = 'https://github.com/hello/world.git', checkout = 'foobar'
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c0/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
>           subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

cookiecutter/vcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (['git', 'clone', 'https://github.com/hello/world.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c0/clone_dir/world'],)
kwargs = {'stderr': -1, 'stdout': -1}
process = <Popen: returncode: 128 args: ['git', 'clone', 'https://github.com/hello/wor...>
stdout = b''
stderr = b"Cloning into '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c0/clone_dir/world'...\nfatal: could not read Username for 'https://github.com': No such device or address\n"
retcode = 128

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/hello/world.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c0/clone_dir/world']' returned non-zero exit status 128.

/usr/lib/python3.10/subprocess.py:526: CalledProcessError

The above exception was the direct cause of the following exception:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac17dd870>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c0/clone_dir')
repo_type = 'git', repo_url = 'https://github.com/hello/world.git'
repo_name = 'world'

    @pytest.mark.parametrize(
        'repo_type, repo_url, repo_name',
        [
            ('git', 'https://github.com/hello/world.git', 'world'),
            ('hg', 'https://bitbucket.org/foo/bar', 'bar'),
            ('git', 'git@host:gitoliterepo', 'gitoliterepo'),
            ('git', 'git@gitlab.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
            ('git', 'git@github.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
        ],
    )
    def test_clone_should_invoke_vcs_command(
        mocker, clone_dir, repo_type, repo_url, repo_name
    ):
        """When `clone()` is called with a git/hg repo, the corresponding VCS \
        command should be run via `subprocess.check_output()`.
    
        This should take place:
        * In the correct dir
        * With the correct args.
        """
        mocker.patch('cookiecutter.vcs.is_vcs_installed', autospec=True, return_value=True)
    
        mock_subprocess = mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
        )
        expected_repo_dir = os.path.normpath(os.path.join(clone_dir, repo_name))
    
        branch = 'foobar'
    
>       repo_dir = vcs.clone(
            repo_url, checkout=branch, clone_to_dir=clone_dir, no_input=True
        )

tests/vcs/test_clone.py:117: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'https://github.com/hello/world.git', checkout = 'foobar'
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c0/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
            subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except subprocess.CalledProcessError as e:
>           raise RepositoryCloneFailed(f'Failed to clone repository: {e}') from e
E           cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'https://github.com/hello/world.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c0/clone_dir/world']' returned non-zero exit status 128.

cookiecutter/vcs.py:71: RepositoryCloneFailed
__ test_clone_should_invoke_vcs_command[hg-https://bitbucket.org/foo/bar-bar] __

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac10edf30>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c1/clone_dir')
repo_type = 'hg', repo_url = 'https://bitbucket.org/foo/bar', repo_name = 'bar'

    @pytest.mark.parametrize(
        'repo_type, repo_url, repo_name',
        [
            ('git', 'https://github.com/hello/world.git', 'world'),
            ('hg', 'https://bitbucket.org/foo/bar', 'bar'),
            ('git', 'git@host:gitoliterepo', 'gitoliterepo'),
            ('git', 'git@gitlab.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
            ('git', 'git@github.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
        ],
    )
    def test_clone_should_invoke_vcs_command(
        mocker, clone_dir, repo_type, repo_url, repo_name
    ):
        """When `clone()` is called with a git/hg repo, the corresponding VCS \
        command should be run via `subprocess.check_output()`.
    
        This should take place:
        * In the correct dir
        * With the correct args.
        """
        mocker.patch('cookiecutter.vcs.is_vcs_installed', autospec=True, return_value=True)
    
        mock_subprocess = mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
        )
        expected_repo_dir = os.path.normpath(os.path.join(clone_dir, repo_name))
    
        branch = 'foobar'
    
>       repo_dir = vcs.clone(
            repo_url, checkout=branch, clone_to_dir=clone_dir, no_input=True
        )

tests/vcs/test_clone.py:117: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/vcs.py:69: in clone
    subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
/usr/lib/python3.10/subprocess.py:503: in run
    with Popen(*popenargs, **kwargs) as process:
/usr/lib/python3.10/subprocess.py:971: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Popen: returncode: 255 args: ['hg', 'clone', 'https://bitbucket.org/foo/bar...>
args = ['hg', 'clone', 'https://bitbucket.org/foo/bar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c1/clone_dir/bar', '--branch', 'foobar']
executable = b'hg', preexec_fn = None, close_fds = True, pass_fds = ()
cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False
p2cread = -1, p2cwrite = -1, c2pread = 11, c2pwrite = 12, errread = 13
errwrite = 14, restore_signals = True, gid = None, gids = None, uid = None
umask = -1, start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       restore_signals,
                       gid, gids, uid, umask,
                       start_new_session):
        """Execute program (POSIX version)"""
    
        if isinstance(args, (str, bytes)):
            args = [args]
        elif isinstance(args, os.PathLike):
            if shell:
                raise TypeError('path-like args is not allowed when '
                                'shell is true')
            args = [args]
        else:
            args = list(args)
    
        if shell:
            # On Android the default shell is at '/system/bin/sh'.
            unix_shell = ('/system/bin/sh' if
                      hasattr(sys, 'getandroidapilevel') else '/bin/sh')
            args = [unix_shell, "-c"] + args
            if executable:
                args[0] = executable
    
        if executable is None:
            executable = args[0]
    
        sys.audit("subprocess.Popen", executable, args, cwd, env)
    
        if (_USE_POSIX_SPAWN
                and os.path.dirname(executable)
                and preexec_fn is None
                and not close_fds
                and not pass_fds
                and cwd is None
                and (p2cread == -1 or p2cread > 2)
                and (c2pwrite == -1 or c2pwrite > 2)
                and (errwrite == -1 or errwrite > 2)
                and not start_new_session
                and gid is None
                and gids is None
                and uid is None
                and umask < 0):
            self._posix_spawn(args, executable, env, restore_signals,
                              p2cread, p2cwrite,
                              c2pread, c2pwrite,
                              errread, errwrite)
            return
    
        orig_executable = executable
    
        # For transferring possible exec failure from child to parent.
        # Data format: "exception name:hex errno:description"
        # Pickle is not used; it is complex and involves memory allocation.
        errpipe_read, errpipe_write = os.pipe()
        # errpipe_write must not be in the standard io 0, 1, or 2 fd range.
        low_fds_to_close = []
        while errpipe_write < 3:
            low_fds_to_close.append(errpipe_write)
            errpipe_write = os.dup(errpipe_write)
        for low_fd in low_fds_to_close:
            os.close(low_fd)
        try:
            try:
                # We must avoid complex work that could involve
                # malloc or free in the child process to avoid
                # potential deadlocks, thus we do all this here.
                # and pass it to fork_exec()
    
                if env is not None:
                    env_list = []
                    for k, v in env.items():
                        k = os.fsencode(k)
                        if b'=' in k:
                            raise ValueError("illegal environment variable name")
                        env_list.append(k + b'=' + os.fsencode(v))
                else:
                    env_list = None  # Use execv instead of execve.
                executable = os.fsencode(executable)
                if os.path.dirname(executable):
                    executable_list = (executable,)
                else:
                    # This matches the behavior of os._execvpe().
                    executable_list = tuple(
                        os.path.join(os.fsencode(dir), executable)
                        for dir in os.get_exec_path(env))
                fds_to_keep = set(pass_fds)
                fds_to_keep.add(errpipe_write)
                self.pid = _posixsubprocess.fork_exec(
                        args, executable_list,
                        close_fds, tuple(sorted(map(int, fds_to_keep))),
                        cwd, env_list,
                        p2cread, p2cwrite, c2pread, c2pwrite,
                        errread, errwrite,
                        errpipe_read, errpipe_write,
                        restore_signals, start_new_session,
                        gid, gids, uid, umask,
                        preexec_fn)
                self._child_created = True
            finally:
                # be sure the FD is closed no matter what
                os.close(errpipe_write)
    
            self._close_pipe_fds(p2cread, p2cwrite,
                                 c2pread, c2pwrite,
                                 errread, errwrite)
    
            # Wait for exec to fail or succeed; possibly raising an
            # exception (limited in size)
            errpipe_data = bytearray()
            while True:
                part = os.read(errpipe_read, 50000)
                errpipe_data += part
                if not part or len(errpipe_data) > 50000:
                    break
        finally:
            # be sure the FD is closed no matter what
            os.close(errpipe_read)
    
        if errpipe_data:
            try:
                pid, sts = os.waitpid(self.pid, 0)
                if pid == self.pid:
                    self._handle_exitstatus(sts)
                else:
                    self.returncode = sys.maxsize
            except ChildProcessError:
                pass
    
            try:
                exception_name, hex_errno, err_msg = (
                        errpipe_data.split(b':', 2))
                # The encoding here should match the encoding
                # written in by the subprocess implementations
                # like _posixsubprocess
                err_msg = err_msg.decode()
            except ValueError:
                exception_name = b'SubprocessError'
                hex_errno = b'0'
                err_msg = 'Bad exception data from child: {!r}'.format(
                              bytes(errpipe_data))
            child_exception_type = getattr(
                    builtins, exception_name.decode('ascii'),
                    SubprocessError)
            if issubclass(child_exception_type, OSError) and hex_errno:
                errno_num = int(hex_errno, 16)
                child_exec_never_called = (err_msg == "noexec")
                if child_exec_never_called:
                    err_msg = ""
                    # The error must be from chdir(cwd).
                    err_filename = cwd
                else:
                    err_filename = orig_executable
                if errno_num != 0:
                    err_msg = os.strerror(errno_num)
>               raise child_exception_type(errno_num, err_msg, err_filename)
E               PermissionError: [Errno 13] Permission denied: 'hg'

/usr/lib/python3.10/subprocess.py:1863: PermissionError
_ test_clone_should_invoke_vcs_command[git-git@host:gitoliterepo-gitoliterepo] _

repo_url = 'git@host:gitoliterepo', checkout = 'foobar'
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c2/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
>           subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

cookiecutter/vcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (['git', 'clone', 'git@host:gitoliterepo', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c2/clone_dir/git@host:gitoliterepo'],)
kwargs = {'stderr': -1, 'stdout': -1}
process = <Popen: returncode: 128 args: ['git', 'clone', 'git@host:gitoliterepo', '--b...>
stdout = b''
stderr = b"Cloning into '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c2/clone_dir/git@host:gitoliterepo'...\nssh: Could not resolve hostname host: No address associated with hostname\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n"
retcode = 128

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['git', 'clone', 'git@host:gitoliterepo', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c2/clone_dir/git@host:gitoliterepo']' returned non-zero exit status 128.

/usr/lib/python3.10/subprocess.py:526: CalledProcessError

The above exception was the direct cause of the following exception:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac15d5fc0>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c2/clone_dir')
repo_type = 'git', repo_url = 'git@host:gitoliterepo'
repo_name = 'gitoliterepo'

    @pytest.mark.parametrize(
        'repo_type, repo_url, repo_name',
        [
            ('git', 'https://github.com/hello/world.git', 'world'),
            ('hg', 'https://bitbucket.org/foo/bar', 'bar'),
            ('git', 'git@host:gitoliterepo', 'gitoliterepo'),
            ('git', 'git@gitlab.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
            ('git', 'git@github.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
        ],
    )
    def test_clone_should_invoke_vcs_command(
        mocker, clone_dir, repo_type, repo_url, repo_name
    ):
        """When `clone()` is called with a git/hg repo, the corresponding VCS \
        command should be run via `subprocess.check_output()`.
    
        This should take place:
        * In the correct dir
        * With the correct args.
        """
        mocker.patch('cookiecutter.vcs.is_vcs_installed', autospec=True, return_value=True)
    
        mock_subprocess = mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
        )
        expected_repo_dir = os.path.normpath(os.path.join(clone_dir, repo_name))
    
        branch = 'foobar'
    
>       repo_dir = vcs.clone(
            repo_url, checkout=branch, clone_to_dir=clone_dir, no_input=True
        )

tests/vcs/test_clone.py:117: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'git@host:gitoliterepo', checkout = 'foobar'
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c2/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
            subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except subprocess.CalledProcessError as e:
>           raise RepositoryCloneFailed(f'Failed to clone repository: {e}') from e
E           cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'git@host:gitoliterepo', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c2/clone_dir/git@host:gitoliterepo']' returned non-zero exit status 128.

cookiecutter/vcs.py:71: RepositoryCloneFailed
_ test_clone_should_invoke_vcs_command[git-git@gitlab.com:cookiecutter/cookiecutter.git-cookiecutter] _

repo_url = 'git@gitlab.com:cookiecutter/cookiecutter.git', checkout = 'foobar'
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c3/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
>           subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

cookiecutter/vcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (['git', 'clone', 'git@gitlab.com:cookiecutter/cookiecutter.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c3/clone_dir/cookiecutter'],)
kwargs = {'stderr': -1, 'stdout': -1}
process = <Popen: returncode: 128 args: ['git', 'clone', 'git@gitlab.com:cookiecutter/...>
stdout = b''
stderr = b"Cloning into '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c3/clone_dir/cookiecutter'...\nHost key verification failed.\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n"
retcode = 128

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['git', 'clone', 'git@gitlab.com:cookiecutter/cookiecutter.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c3/clone_dir/cookiecutter']' returned non-zero exit status 128.

/usr/lib/python3.10/subprocess.py:526: CalledProcessError

The above exception was the direct cause of the following exception:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac14367d0>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c3/clone_dir')
repo_type = 'git', repo_url = 'git@gitlab.com:cookiecutter/cookiecutter.git'
repo_name = 'cookiecutter'

    @pytest.mark.parametrize(
        'repo_type, repo_url, repo_name',
        [
            ('git', 'https://github.com/hello/world.git', 'world'),
            ('hg', 'https://bitbucket.org/foo/bar', 'bar'),
            ('git', 'git@host:gitoliterepo', 'gitoliterepo'),
            ('git', 'git@gitlab.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
            ('git', 'git@github.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
        ],
    )
    def test_clone_should_invoke_vcs_command(
        mocker, clone_dir, repo_type, repo_url, repo_name
    ):
        """When `clone()` is called with a git/hg repo, the corresponding VCS \
        command should be run via `subprocess.check_output()`.
    
        This should take place:
        * In the correct dir
        * With the correct args.
        """
        mocker.patch('cookiecutter.vcs.is_vcs_installed', autospec=True, return_value=True)
    
        mock_subprocess = mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
        )
        expected_repo_dir = os.path.normpath(os.path.join(clone_dir, repo_name))
    
        branch = 'foobar'
    
>       repo_dir = vcs.clone(
            repo_url, checkout=branch, clone_to_dir=clone_dir, no_input=True
        )

tests/vcs/test_clone.py:117: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'git@gitlab.com:cookiecutter/cookiecutter.git', checkout = 'foobar'
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c3/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
            subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except subprocess.CalledProcessError as e:
>           raise RepositoryCloneFailed(f'Failed to clone repository: {e}') from e
E           cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'git@gitlab.com:cookiecutter/cookiecutter.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c3/clone_dir/cookiecutter']' returned non-zero exit status 128.

cookiecutter/vcs.py:71: RepositoryCloneFailed
_ test_clone_should_invoke_vcs_command[git-git@github.com:cookiecutter/cookiecutter.git-cookiecutter] _

repo_url = 'git@github.com:cookiecutter/cookiecutter.git', checkout = 'foobar'
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c4/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
>           subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

cookiecutter/vcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (['git', 'clone', 'git@github.com:cookiecutter/cookiecutter.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c4/clone_dir/cookiecutter'],)
kwargs = {'stderr': -1, 'stdout': -1}
process = <Popen: returncode: 128 args: ['git', 'clone', 'git@github.com:cookiecutter/...>
stdout = b''
stderr = b"Cloning into '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c4/clone_dir/cookiecutter'...\nHost key verification failed.\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n"
retcode = 128

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['git', 'clone', 'git@github.com:cookiecutter/cookiecutter.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c4/clone_dir/cookiecutter']' returned non-zero exit status 128.

/usr/lib/python3.10/subprocess.py:526: CalledProcessError

The above exception was the direct cause of the following exception:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac13ff160>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c4/clone_dir')
repo_type = 'git', repo_url = 'git@github.com:cookiecutter/cookiecutter.git'
repo_name = 'cookiecutter'

    @pytest.mark.parametrize(
        'repo_type, repo_url, repo_name',
        [
            ('git', 'https://github.com/hello/world.git', 'world'),
            ('hg', 'https://bitbucket.org/foo/bar', 'bar'),
            ('git', 'git@host:gitoliterepo', 'gitoliterepo'),
            ('git', 'git@gitlab.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
            ('git', 'git@github.com:cookiecutter/cookiecutter.git', 'cookiecutter'),
        ],
    )
    def test_clone_should_invoke_vcs_command(
        mocker, clone_dir, repo_type, repo_url, repo_name
    ):
        """When `clone()` is called with a git/hg repo, the corresponding VCS \
        command should be run via `subprocess.check_output()`.
    
        This should take place:
        * In the correct dir
        * With the correct args.
        """
        mocker.patch('cookiecutter.vcs.is_vcs_installed', autospec=True, return_value=True)
    
        mock_subprocess = mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
        )
        expected_repo_dir = os.path.normpath(os.path.join(clone_dir, repo_name))
    
        branch = 'foobar'
    
>       repo_dir = vcs.clone(
            repo_url, checkout=branch, clone_to_dir=clone_dir, no_input=True
        )

tests/vcs/test_clone.py:117: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'git@github.com:cookiecutter/cookiecutter.git', checkout = 'foobar'
clone_to_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c4/clone_dir')
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
            subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except subprocess.CalledProcessError as e:
>           raise RepositoryCloneFailed(f'Failed to clone repository: {e}') from e
E           cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'git@github.com:cookiecutter/cookiecutter.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c4/clone_dir/cookiecutter']' returned non-zero exit status 128.

cookiecutter/vcs.py:71: RepositoryCloneFailed
_ test_clone_handles_repo_typo[fatal: repository 'https://github.com/hackebro/cookiedozer' not found] _

repo_url = 'https://github.com/hackebro/cookiedozer', checkout = None
clone_to_dir = '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_f0/clone_dir'
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
>           subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

cookiecutter/vcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (['git', 'clone', 'https://github.com/hackebro/cookiedozer', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_f0/clone_dir/cookiedozer'],)
kwargs = {'stderr': -1, 'stdout': -1}
process = <Popen: returncode: 128 args: ['git', 'clone', 'https://github.com/hackebro/...>
stdout = b''
stderr = b"Cloning into '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_f0/clone_dir/cookiedozer'...\nfatal: could not read Username for 'https://github.com': No such device or address\n"
retcode = 128

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/hackebro/cookiedozer', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_f0/clone_dir/cookiedozer']' returned non-zero exit status 128.

/usr/lib/python3.10/subprocess.py:526: CalledProcessError

The above exception was the direct cause of the following exception:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1e2b970>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_f0/clone_dir')
error_message = b"fatal: repository 'https://github.com/hackebro/cookiedozer' not found"

    @pytest.mark.parametrize(
        'error_message',
        [
            (b"fatal: repository 'https://github.com/hackebro/cookiedozer' not found"),
            b'hg: abort: HTTP Error 404: Not Found',
        ],
    )
    def test_clone_handles_repo_typo(mocker, clone_dir, error_message):
        """In `clone()`, repository not found errors should raise an \
        appropriate exception."""
        # side_effect is set to an iterable here (and below),
        # because of a Python 3.4 unittest.mock regression
        # http://bugs.python.org/issue23661
        mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
            side_effect=[subprocess.CalledProcessError(-1, 'cmd', output=error_message)],
        )
    
        repository_url = 'https://github.com/hackebro/cookiedozer'
        with pytest.raises(exceptions.RepositoryNotFound) as err:
>           vcs.clone(repository_url, clone_to_dir=str(clone_dir), no_input=True)

tests/vcs/test_clone.py:160: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'https://github.com/hackebro/cookiedozer', checkout = None
clone_to_dir = '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_f0/clone_dir'
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
            subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except subprocess.CalledProcessError as e:
>           raise RepositoryCloneFailed(f'Failed to clone repository: {e}') from e
E           cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'https://github.com/hackebro/cookiedozer', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_f0/clone_dir/cookiedozer']' returned non-zero exit status 128.

cookiecutter/vcs.py:71: RepositoryCloneFailed
______ test_clone_handles_repo_typo[hg: abort: HTTP Error 404: Not Found] ______

repo_url = 'https://github.com/hackebro/cookiedozer', checkout = None
clone_to_dir = '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_h0/clone_dir'
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
>           subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

cookiecutter/vcs.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

input = None, capture_output = False, timeout = None, check = True
popenargs = (['git', 'clone', 'https://github.com/hackebro/cookiedozer', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_h0/clone_dir/cookiedozer'],)
kwargs = {'stderr': -1, 'stdout': -1}
process = <Popen: returncode: 128 args: ['git', 'clone', 'https://github.com/hackebro/...>
stdout = b''
stderr = b"Cloning into '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_h0/clone_dir/cookiedozer'...\nfatal: could not read Username for 'https://github.com': No such device or address\n"
retcode = 128

    def run(*popenargs,
            input=None, capture_output=False, timeout=None, check=False, **kwargs):
        """Run command with arguments and return a CompletedProcess instance.
    
        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.
    
        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.
    
        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.
    
        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.
    
        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.
    
        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
    
        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
    
        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/hackebro/cookiedozer', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_h0/clone_dir/cookiedozer']' returned non-zero exit status 128.

/usr/lib/python3.10/subprocess.py:526: CalledProcessError

The above exception was the direct cause of the following exception:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1de4dc0>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_h0/clone_dir')
error_message = b'hg: abort: HTTP Error 404: Not Found'

    @pytest.mark.parametrize(
        'error_message',
        [
            (b"fatal: repository 'https://github.com/hackebro/cookiedozer' not found"),
            b'hg: abort: HTTP Error 404: Not Found',
        ],
    )
    def test_clone_handles_repo_typo(mocker, clone_dir, error_message):
        """In `clone()`, repository not found errors should raise an \
        appropriate exception."""
        # side_effect is set to an iterable here (and below),
        # because of a Python 3.4 unittest.mock regression
        # http://bugs.python.org/issue23661
        mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
            side_effect=[subprocess.CalledProcessError(-1, 'cmd', output=error_message)],
        )
    
        repository_url = 'https://github.com/hackebro/cookiedozer'
        with pytest.raises(exceptions.RepositoryNotFound) as err:
>           vcs.clone(repository_url, clone_to_dir=str(clone_dir), no_input=True)

tests/vcs/test_clone.py:160: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'https://github.com/hackebro/cookiedozer', checkout = None
clone_to_dir = '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_h0/clone_dir'
no_input = True

    def clone(repo_url: str, checkout: Optional[str]=None, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False):
        """Clone a repo to the current directory.
    
        :param repo_url: Repo URL of unknown type.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param clone_to_dir: The directory to clone to.
                             Defaults to the current directory.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :returns: str with path to the new directory of the repository.
        """
        repo_type, repo_url = identify_repo(repo_url)
        repo_name = repo_url.split('/')[-1].split('.')[0]
        repo_dir = Path(clone_to_dir).resolve() / repo_name
    
        if not is_vcs_installed(repo_type):
            raise VCSNotInstalled(f'{repo_type} is not installed.')
    
        if repo_type == 'git':
            cmd = ['git', 'clone', repo_url]
            if checkout:
                cmd.extend(['--branch', checkout])
            cmd.append(str(repo_dir))
        elif repo_type == 'hg':
            cmd = ['hg', 'clone', repo_url, str(repo_dir)]
            if checkout:
                cmd.extend(['--branch', checkout])
    
        try:
            subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except subprocess.CalledProcessError as e:
>           raise RepositoryCloneFailed(f'Failed to clone repository: {e}') from e
E           cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'https://github.com/hackebro/cookiedozer', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_h0/clone_dir/cookiedozer']' returned non-zero exit status 128.

cookiecutter/vcs.py:71: RepositoryCloneFailed
_ test_clone_handles_branch_typo[error: pathspec 'unknown_branch' did not match any file(s) known to git] _

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac17c0070>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo0/clone_dir')
error_message = b"error: pathspec 'unknown_branch' did not match any file(s) known to git"

    @pytest.mark.parametrize(
        'error_message',
        [
            b"error: pathspec 'unknown_branch' did not match any file(s) known to git",
            b"hg: abort: unknown revision 'unknown_branch'!",
        ],
    )
    def test_clone_handles_branch_typo(mocker, clone_dir, error_message):
        """In `clone()`, branch not found errors should raise an \
        appropriate exception."""
        mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
            side_effect=[subprocess.CalledProcessError(-1, 'cmd', output=error_message)],
        )
    
        repository_url = 'https://github.com/pytest-dev/cookiecutter-pytest-plugin'
        with pytest.raises(exceptions.RepositoryCloneFailed) as err:
            vcs.clone(
                repository_url,
                clone_to_dir=str(clone_dir),
                checkout='unknown_branch',
                no_input=True,
            )
    
>       assert str(err.value) == (
            'The unknown_branch branch of repository '
            f'{repository_url} could not found, have you made a typo?'
        )
E       assert "Failed to clone repository: Command '['git', 'clone', 'https://github.com/pytest-dev/cookiecutter-pytest-plugin', '--branch', 'unknown_branch', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo0/clone_dir/cookiecutter-pytest-plugin']' returned non-zero exit status 128." == 'The unknown_branch branch of repository https://github.com/pytest-dev/cookiecutter-pytest-plugin could not found, have you made a typo?'
E         
E         - The unknown_branch branch of repository https://github.com/pytest-dev/cookiecutter-pytest-plugin could not found, have you made a typo?
E         + Failed to clone repository: Command '['git', 'clone', 'https://github.com/pytest-dev/cookiecutter-pytest-plugin', '--branch', 'unknown_branch', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo0/clone_dir/cookiecutter-pytest-plugin']' returned non-zero exit status 128.

tests/vcs/test_clone.py:192: AssertionError
_ test_clone_handles_branch_typo[hg: abort: unknown revision 'unknown_branch'!] _

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1886e00>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo1/clone_dir')
error_message = b"hg: abort: unknown revision 'unknown_branch'!"

    @pytest.mark.parametrize(
        'error_message',
        [
            b"error: pathspec 'unknown_branch' did not match any file(s) known to git",
            b"hg: abort: unknown revision 'unknown_branch'!",
        ],
    )
    def test_clone_handles_branch_typo(mocker, clone_dir, error_message):
        """In `clone()`, branch not found errors should raise an \
        appropriate exception."""
        mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
            side_effect=[subprocess.CalledProcessError(-1, 'cmd', output=error_message)],
        )
    
        repository_url = 'https://github.com/pytest-dev/cookiecutter-pytest-plugin'
        with pytest.raises(exceptions.RepositoryCloneFailed) as err:
            vcs.clone(
                repository_url,
                clone_to_dir=str(clone_dir),
                checkout='unknown_branch',
                no_input=True,
            )
    
>       assert str(err.value) == (
            'The unknown_branch branch of repository '
            f'{repository_url} could not found, have you made a typo?'
        )
E       assert "Failed to clone repository: Command '['git', 'clone', 'https://github.com/pytest-dev/cookiecutter-pytest-plugin', '--branch', 'unknown_branch', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo1/clone_dir/cookiecutter-pytest-plugin']' returned non-zero exit status 128." == 'The unknown_branch branch of repository https://github.com/pytest-dev/cookiecutter-pytest-plugin could not found, have you made a typo?'
E         
E         - The unknown_branch branch of repository https://github.com/pytest-dev/cookiecutter-pytest-plugin could not found, have you made a typo?
E         + Failed to clone repository: Command '['git', 'clone', 'https://github.com/pytest-dev/cookiecutter-pytest-plugin', '--branch', 'unknown_branch', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo1/clone_dir/cookiecutter-pytest-plugin']' returned non-zero exit status 128.

tests/vcs/test_clone.py:192: AssertionError
_____________________ test_clone_unknown_subprocess_error ______________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac13fcf40>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_clone_unknown_subprocess_0/clone_dir')

    def test_clone_unknown_subprocess_error(mocker, clone_dir):
        """In `clone()`, unknown subprocess errors should be raised."""
        mocker.patch(
            'cookiecutter.vcs.subprocess.check_output',
            autospec=True,
            side_effect=[
                subprocess.CalledProcessError(-1, 'cmd', output=b'Something went wrong')
            ],
        )
    
>       with pytest.raises(subprocess.CalledProcessError):
E       Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>

tests/vcs/test_clone.py:208: Failed
_________________ test_identify_raise_on_unknown_repo[foo+git] _________________

unknown_repo_type_url = 'foo+git'

    def test_identify_raise_on_unknown_repo(unknown_repo_type_url):
        """Verify different incorrect repositories url syntax trigger error raising."""
>       with pytest.raises(exceptions.UnknownRepoType):
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>

tests/vcs/test_identify_repo.py:70: Failed
_________________ test_identify_raise_on_unknown_repo[foo+hg] __________________

unknown_repo_type_url = 'foo+hg'

    def test_identify_raise_on_unknown_repo(unknown_repo_type_url):
        """Verify different incorrect repositories url syntax trigger error raising."""
>       with pytest.raises(exceptions.UnknownRepoType):
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>

tests/vcs/test_identify_repo.py:70: Failed
_________________ test_identify_raise_on_unknown_repo[foo+bar] _________________

unknown_repo_type_url = 'foo+bar'

    def test_identify_raise_on_unknown_repo(unknown_repo_type_url):
        """Verify different incorrect repositories url syntax trigger error raising."""
>       with pytest.raises(exceptions.UnknownRepoType):
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>

tests/vcs/test_identify_repo.py:70: Failed
_________________ test_identify_raise_on_unknown_repo[foobar] __________________

unknown_repo_type_url = 'foobar'

    def test_identify_raise_on_unknown_repo(unknown_repo_type_url):
        """Verify different incorrect repositories url syntax trigger error raising."""
>       with pytest.raises(exceptions.UnknownRepoType):
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>

tests/vcs/test_identify_repo.py:70: Failed
_____ test_identify_raise_on_unknown_repo[http://norepotypespecified.com] ______

unknown_repo_type_url = 'http://norepotypespecified.com'

    def test_identify_raise_on_unknown_repo(unknown_repo_type_url):
        """Verify different incorrect repositories url syntax trigger error raising."""
>       with pytest.raises(exceptions.UnknownRepoType):
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>

tests/vcs/test_identify_repo.py:70: Failed
________________________ test_is_vcs_installed[-False] _________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac27ff040>
which_return = '', result = False

    @pytest.mark.parametrize(
        'which_return, result',
        [('', False), (None, False), (False, False), ('/usr/local/bin/git', True)],
    )
    def test_is_vcs_installed(mocker, which_return, result):
        """Verify `is_vcs_installed` function correctly handles `which` answer."""
        mocker.patch('cookiecutter.vcs.which', autospec=True, return_value=which_return)
>       assert vcs.is_vcs_installed('git') == result
E       AssertionError: assert True == False
E        +  where True = <function is_vcs_installed at 0x7c8ac24131c0>('git')
E        +    where <function is_vcs_installed at 0x7c8ac24131c0> = vcs.is_vcs_installed

tests/vcs/test_is_vcs_installed.py:15: AssertionError
______________________ test_is_vcs_installed[False-False] ______________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1420130>
which_return = False, result = False

    @pytest.mark.parametrize(
        'which_return, result',
        [('', False), (None, False), (False, False), ('/usr/local/bin/git', True)],
    )
    def test_is_vcs_installed(mocker, which_return, result):
        """Verify `is_vcs_installed` function correctly handles `which` answer."""
        mocker.patch('cookiecutter.vcs.which', autospec=True, return_value=which_return)
>       assert vcs.is_vcs_installed('git') == result
E       AssertionError: assert True == False
E        +  where True = <function is_vcs_installed at 0x7c8ac24131c0>('git')
E        +    where <function is_vcs_installed at 0x7c8ac24131c0> = vcs.is_vcs_installed

tests/vcs/test_is_vcs_installed.py:15: AssertionError
__________ test_unzip_protected_local_file_user_password_with_noinput __________

prompt = '', stream = None

    def unix_getpass(prompt='Password: ', stream=None):
        """Prompt for a password, with echo turned off.
    
        Args:
          prompt: Written on stream to ask for the input.  Default: 'Password: '
          stream: A writable file object to display the prompt.  Defaults to
                  the tty.  If no tty is available defaults to sys.stderr.
        Returns:
          The seKr3t input.
        Raises:
          EOFError: If our input tty or stdin was closed.
          GetPassWarning: When we were unable to turn echo off on the input.
    
        Always restores terminal settings before returning.
        """
        passwd = None
        with contextlib.ExitStack() as stack:
            try:
                # Always try reading and writing directly on the tty first.
>               fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY)
E               OSError: [Errno 6] No such device or address: '/dev/tty'

/usr/lib/python3.10/getpass.py:48: OSError

During handling of the above exception, another exception occurred:

prompt = '', stream = None

    def unix_getpass(prompt='Password: ', stream=None):
        """Prompt for a password, with echo turned off.
    
        Args:
          prompt: Written on stream to ask for the input.  Default: 'Password: '
          stream: A writable file object to display the prompt.  Defaults to
                  the tty.  If no tty is available defaults to sys.stderr.
        Returns:
          The seKr3t input.
        Raises:
          EOFError: If our input tty or stdin was closed.
          GetPassWarning: When we were unable to turn echo off on the input.
    
        Always restores terminal settings before returning.
        """
        passwd = None
        with contextlib.ExitStack() as stack:
            try:
                # Always try reading and writing directly on the tty first.
                fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY)
                tty = io.FileIO(fd, 'w+')
                stack.enter_context(tty)
                input = io.TextIOWrapper(tty)
                stack.enter_context(input)
                if not stream:
                    stream = input
            except OSError:
                # If that fails, see if stdin can be controlled.
                stack.close()
                try:
>                   fd = sys.stdin.fileno()
E                   io.UnsupportedOperation: redirected stdin is pseudofile, has no fileno()

/usr/lib/python3.10/getpass.py:59: UnsupportedOperation

During handling of the above exception, another exception occurred:

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac141dde0>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_unzip_protected_local_fil2/clone_dir')

    def test_unzip_protected_local_file_user_password_with_noinput(mocker, clone_dir):
        """Can't unpack a password-protected repo in no_input mode."""
        mocker.patch(
            'cookiecutter.zipfile.prompt_and_delete', return_value=True, autospec=True
        )
    
        with pytest.raises(InvalidZipRepository):
>           zipfile.unzip(
                'tests/files/protected-fake-repo-tmpl.zip',
                is_url=False,
                clone_to_dir=str(clone_dir),
                no_input=True,
            )

tests/zipfile/test_unzip.py:85: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/zipfile.py:52: in unzip
    password = read_repo_password('The repository zip file is encrypted, password needed:')
cookiecutter/prompt.py:58: in read_repo_password
    return Prompt.ask(question, password=True)
/home/openhands/.local/lib/python3.10/site-packages/rich/prompt.py:149: in ask
    return _prompt(default=default, stream=stream)
/home/openhands/.local/lib/python3.10/site-packages/rich/prompt.py:292: in __call__
    value = self.get_input(self.console, prompt, self.password, stream=stream)
/home/openhands/.local/lib/python3.10/site-packages/rich/prompt.py:211: in get_input
    return console.input(prompt, password=password, stream=stream)
/home/openhands/.local/lib/python3.10/site-packages/rich/console.py:2169: in input
    result = getpass("", stream=stream)
/usr/lib/python3.10/getpass.py:62: in unix_getpass
    passwd = fallback_getpass(prompt, stream)
/usr/lib/python3.10/getpass.py:126: in fallback_getpass
    return _raw_input(prompt, stream)
/usr/lib/python3.10/getpass.py:146: in _raw_input
    line = input.readline()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_pytest.capture.DontReadFromInput object at 0x7c8ac3a35f00>, size = -1

    def read(self, size: int = -1) -> str:
>       raise OSError(
            "pytest: reading from stdin while output is captured!  Consider using `-s`."
        )
E       OSError: pytest: reading from stdin while output is captured!  Consider using `-s`.

/home/openhands/.local/lib/python3.10/site-packages/_pytest/capture.py:229: OSError
----------------------------- Captured stdout call -----------------------------
The repository zip file is encrypted, password needed:: 
----------------------------- Captured stderr call -----------------------------
Warning: Password input may be echoed.
_____________________________ test_empty_zip_file ______________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac13fe380>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_empty_zip_file0/clone_dir')

    def test_empty_zip_file(mocker, clone_dir):
        """In `unzip()`, an empty file raises an error."""
        mocker.patch(
            'cookiecutter.zipfile.prompt_and_delete', return_value=True, autospec=True
        )
    
>       with pytest.raises(InvalidZipRepository):
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.InvalidZipRepository'>

tests/zipfile/test_unzip.py:133: Failed
____________________________ test_non_repo_zip_file ____________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac157fb20>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_non_repo_zip_file0/clone_dir')

    def test_non_repo_zip_file(mocker, clone_dir):
        """In `unzip()`, a repository must have a top level directory."""
        mocker.patch(
            'cookiecutter.zipfile.prompt_and_delete', return_value=True, autospec=True
        )
    
>       with pytest.raises(InvalidZipRepository):
E       Failed: DID NOT RAISE <class 'cookiecutter.exceptions.InvalidZipRepository'>

tests/zipfile/test_unzip.py:145: Failed
________________________________ test_unzip_url ________________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac148a5f0>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_unzip_url0/clone_dir')

    def test_unzip_url(mocker, clone_dir):
        """In `unzip()`, a url will be downloaded and unzipped."""
        mock_prompt_and_delete = mocker.patch(
            'cookiecutter.zipfile.prompt_and_delete', return_value=True, autospec=True
        )
    
        request = mocker.MagicMock()
        request.iter_content.return_value = mock_download()
    
        mocker.patch(
            'cookiecutter.zipfile.requests.get',
            return_value=request,
            autospec=True,
        )
    
>       output_dir = zipfile.unzip(
            'https://example.com/path/to/fake-repo-tmpl.zip',
            is_url=True,
            clone_to_dir=str(clone_dir),
        )

tests/zipfile/test_unzip.py:178: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

zip_uri = 'https://example.com/path/to/fake-repo-tmpl.zip', is_url = True
clone_to_dir = '/tmp/pytest-of-openhands/pytest-30/test_unzip_url0/clone_dir'
no_input = False, password = None

    def unzip(zip_uri: str, is_url: bool, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False, password: Optional[str]=None):
        """Download and unpack a zipfile at a given URI.
    
        This will download the zipfile to the cookiecutter repository,
        and unpack into a temporary directory.
    
        :param zip_uri: The URI for the zipfile.
        :param is_url: Is the zip URI a URL or a file?
        :param clone_to_dir: The cookiecutter repository directory
            to put the archive into.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :param password: The password to use when unpacking the repository.
        """
        make_sure_path_exists(clone_to_dir)
    
        if is_url:
            # Download the file
            if password:
                r = requests.get(zip_uri, auth=('', password))
            else:
                r = requests.get(zip_uri)
            r.raise_for_status()
    
            zip_path = Path(clone_to_dir) / zip_uri.split('/')[-1]
            with open(zip_path, 'wb') as f:
>               f.write(r.content)
E               TypeError: a bytes-like object is required, not 'MagicMock'

cookiecutter/zipfile.py:38: TypeError
_______________________ test_unzip_url_with_empty_chunks _______________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1437970>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_unzip_url_with_empty_chun0/clone_dir')

    def test_unzip_url_with_empty_chunks(mocker, clone_dir):
        """In `unzip()` empty chunk must be ignored."""
        mock_prompt_and_delete = mocker.patch(
            'cookiecutter.zipfile.prompt_and_delete', return_value=True, autospec=True
        )
    
        request = mocker.MagicMock()
        request.iter_content.return_value = mock_download_with_empty_chunks()
    
        mocker.patch(
            'cookiecutter.zipfile.requests.get',
            return_value=request,
            autospec=True,
        )
    
>       output_dir = zipfile.unzip(
            'https://example.com/path/to/fake-repo-tmpl.zip',
            is_url=True,
            clone_to_dir=str(clone_dir),
        )

tests/zipfile/test_unzip.py:203: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

zip_uri = 'https://example.com/path/to/fake-repo-tmpl.zip', is_url = True
clone_to_dir = '/tmp/pytest-of-openhands/pytest-30/test_unzip_url_with_empty_chun0/clone_dir'
no_input = False, password = None

    def unzip(zip_uri: str, is_url: bool, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False, password: Optional[str]=None):
        """Download and unpack a zipfile at a given URI.
    
        This will download the zipfile to the cookiecutter repository,
        and unpack into a temporary directory.
    
        :param zip_uri: The URI for the zipfile.
        :param is_url: Is the zip URI a URL or a file?
        :param clone_to_dir: The cookiecutter repository directory
            to put the archive into.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :param password: The password to use when unpacking the repository.
        """
        make_sure_path_exists(clone_to_dir)
    
        if is_url:
            # Download the file
            if password:
                r = requests.get(zip_uri, auth=('', password))
            else:
                r = requests.get(zip_uri)
            r.raise_for_status()
    
            zip_path = Path(clone_to_dir) / zip_uri.split('/')[-1]
            with open(zip_path, 'wb') as f:
>               f.write(r.content)
E               TypeError: a bytes-like object is required, not 'MagicMock'

cookiecutter/zipfile.py:38: TypeError
________________________ test_unzip_url_existing_cache _________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac14115a0>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_unzip_url_existing_cache0/clone_dir')

    def test_unzip_url_existing_cache(mocker, clone_dir):
        """Url should be downloaded and unzipped, old zip file will be removed."""
        mock_prompt_and_delete = mocker.patch(
            'cookiecutter.zipfile.prompt_and_delete', return_value=True, autospec=True
        )
    
        request = mocker.MagicMock()
        request.iter_content.return_value = mock_download()
    
        mocker.patch(
            'cookiecutter.zipfile.requests.get',
            return_value=request,
            autospec=True,
        )
    
        # Create an existing cache of the zipfile
        existing_zip = clone_dir.joinpath('fake-repo-tmpl.zip')
        existing_zip.write_text('This is an existing zipfile')
    
>       output_dir = zipfile.unzip(
            'https://example.com/path/to/fake-repo-tmpl.zip',
            is_url=True,
            clone_to_dir=str(clone_dir),
        )

tests/zipfile/test_unzip.py:232: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

zip_uri = 'https://example.com/path/to/fake-repo-tmpl.zip', is_url = True
clone_to_dir = '/tmp/pytest-of-openhands/pytest-30/test_unzip_url_existing_cache0/clone_dir'
no_input = False, password = None

    def unzip(zip_uri: str, is_url: bool, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False, password: Optional[str]=None):
        """Download and unpack a zipfile at a given URI.
    
        This will download the zipfile to the cookiecutter repository,
        and unpack into a temporary directory.
    
        :param zip_uri: The URI for the zipfile.
        :param is_url: Is the zip URI a URL or a file?
        :param clone_to_dir: The cookiecutter repository directory
            to put the archive into.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :param password: The password to use when unpacking the repository.
        """
        make_sure_path_exists(clone_to_dir)
    
        if is_url:
            # Download the file
            if password:
                r = requests.get(zip_uri, auth=('', password))
            else:
                r = requests.get(zip_uri)
            r.raise_for_status()
    
            zip_path = Path(clone_to_dir) / zip_uri.split('/')[-1]
            with open(zip_path, 'wb') as f:
>               f.write(r.content)
E               TypeError: a bytes-like object is required, not 'MagicMock'

cookiecutter/zipfile.py:38: TypeError
____________________ test_unzip_url_existing_cache_no_input ____________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1de6bf0>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_unzip_url_existing_cache_0/clone_dir')

    def test_unzip_url_existing_cache_no_input(mocker, clone_dir):
        """If no_input is provided, the existing file should be removed."""
        request = mocker.MagicMock()
        request.iter_content.return_value = mock_download()
    
        mocker.patch(
            'cookiecutter.zipfile.requests.get',
            return_value=request,
            autospec=True,
        )
    
        # Create an existing cache of the zipfile
        existing_zip = clone_dir.joinpath('fake-repo-tmpl.zip')
        existing_zip.write_text('This is an existing zipfile')
    
>       output_dir = zipfile.unzip(
            'https://example.com/path/to/fake-repo-tmpl.zip',
            is_url=True,
            clone_to_dir=str(clone_dir),
            no_input=True,
        )

tests/zipfile/test_unzip.py:257: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

zip_uri = 'https://example.com/path/to/fake-repo-tmpl.zip', is_url = True
clone_to_dir = '/tmp/pytest-of-openhands/pytest-30/test_unzip_url_existing_cache_0/clone_dir'
no_input = True, password = None

    def unzip(zip_uri: str, is_url: bool, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False, password: Optional[str]=None):
        """Download and unpack a zipfile at a given URI.
    
        This will download the zipfile to the cookiecutter repository,
        and unpack into a temporary directory.
    
        :param zip_uri: The URI for the zipfile.
        :param is_url: Is the zip URI a URL or a file?
        :param clone_to_dir: The cookiecutter repository directory
            to put the archive into.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :param password: The password to use when unpacking the repository.
        """
        make_sure_path_exists(clone_to_dir)
    
        if is_url:
            # Download the file
            if password:
                r = requests.get(zip_uri, auth=('', password))
            else:
                r = requests.get(zip_uri)
            r.raise_for_status()
    
            zip_path = Path(clone_to_dir) / zip_uri.split('/')[-1]
            with open(zip_path, 'wb') as f:
>               f.write(r.content)
E               TypeError: a bytes-like object is required, not 'MagicMock'

cookiecutter/zipfile.py:38: TypeError
___________________ test_unzip_should_abort_if_no_redownload ___________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1dc3220>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_unzip_should_abort_if_no_0/clone_dir')

    def test_unzip_should_abort_if_no_redownload(mocker, clone_dir):
        """Should exit without cloning anything If no redownload."""
        mocker.patch(
            'cookiecutter.zipfile.prompt_and_delete', side_effect=SystemExit, autospec=True
        )
    
        mock_requests_get = mocker.patch(
            'cookiecutter.zipfile.requests.get',
            autospec=True,
        )
    
        # Create an existing cache of the zipfile
        existing_zip = clone_dir.joinpath('fake-repo-tmpl.zip')
        existing_zip.write_text('This is an existing zipfile')
    
        zipfile_url = 'https://example.com/path/to/fake-repo-tmpl.zip'
    
        with pytest.raises(SystemExit):
>           zipfile.unzip(zipfile_url, is_url=True, clone_to_dir=str(clone_dir))

tests/zipfile/test_unzip.py:285: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

zip_uri = 'https://example.com/path/to/fake-repo-tmpl.zip', is_url = True
clone_to_dir = '/tmp/pytest-of-openhands/pytest-30/test_unzip_should_abort_if_no_0/clone_dir'
no_input = False, password = None

    def unzip(zip_uri: str, is_url: bool, clone_to_dir: 'os.PathLike[str]'='.', no_input: bool=False, password: Optional[str]=None):
        """Download and unpack a zipfile at a given URI.
    
        This will download the zipfile to the cookiecutter repository,
        and unpack into a temporary directory.
    
        :param zip_uri: The URI for the zipfile.
        :param is_url: Is the zip URI a URL or a file?
        :param clone_to_dir: The cookiecutter repository directory
            to put the archive into.
        :param no_input: Do not prompt for user input and eventually force a refresh of
            cached resources.
        :param password: The password to use when unpacking the repository.
        """
        make_sure_path_exists(clone_to_dir)
    
        if is_url:
            # Download the file
            if password:
                r = requests.get(zip_uri, auth=('', password))
            else:
                r = requests.get(zip_uri)
            r.raise_for_status()
    
            zip_path = Path(clone_to_dir) / zip_uri.split('/')[-1]
            with open(zip_path, 'wb') as f:
>               f.write(r.content)
E               TypeError: a bytes-like object is required, not 'MagicMock'

cookiecutter/zipfile.py:38: TypeError
__________________________ test_unzip_is_ok_to_reuse ___________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7c8ac1887280>
clone_dir = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_unzip_is_ok_to_reuse0/clone_dir')

    def test_unzip_is_ok_to_reuse(mocker, clone_dir):
        """Already downloaded zip should not be downloaded again."""
        mock_prompt_and_delete = mocker.patch(
            'cookiecutter.zipfile.prompt_and_delete', return_value=False, autospec=True
        )
    
        request = mocker.MagicMock()
    
        existing_zip = clone_dir.joinpath('fake-repo-tmpl.zip')
        shutil.copy('tests/files/fake-repo-tmpl.zip', existing_zip)
    
>       output_dir = zipfile.unzip(
            'https://example.com/path/to/fake-repo-tmpl.zip',
            is_url=True,
            clone_to_dir=str(clone_dir),
        )

tests/zipfile/test_unzip.py:301: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/zipfile.py:34: in unzip
    r.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Response [404]>

    def raise_for_status(self):
        """Raises :class:`HTTPError`, if one occurred."""
    
        http_error_msg = ""
        if isinstance(self.reason, bytes):
            # We attempt to decode utf-8 first because some servers
            # choose to localize their reason strings. If the string
            # isn't utf-8, we fall back to iso-8859-1 for all other
            # encodings. (See PR #3538)
            try:
                reason = self.reason.decode("utf-8")
            except UnicodeDecodeError:
                reason = self.reason.decode("iso-8859-1")
        else:
            reason = self.reason
    
        if 400 <= self.status_code < 500:
            http_error_msg = (
                f"{self.status_code} Client Error: {reason} for url: {self.url}"
            )
    
        elif 500 <= self.status_code < 600:
            http_error_msg = (
                f"{self.status_code} Server Error: {reason} for url: {self.url}"
            )
    
        if http_error_msg:
>           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://example.com/path/to/fake-repo-tmpl.zip

/home/openhands/.local/lib/python3.10/site-packages/requests/models.py:1026: HTTPError
=============================== warnings summary ===============================
tests/zipfile/test_unzip.py::test_unzip_protected_local_file_user_password_with_noinput
  /usr/lib/python3.10/getpass.py:62: GetPassWarning: Can not control echo on the terminal.
    passwd = fallback_getpass(prompt, stream)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
--------------------------------- JSON report ----------------------------------
report saved to: report.json
================================ tests coverage ================================
_______________ coverage: platform linux, python 3.10.12-final-0 _______________

Name                          Stmts   Miss  Cover   Missing
-----------------------------------------------------------
cookiecutter/__init__.py          6      0   100%
cookiecutter/__main__.py          1      0   100%
cookiecutter/cli.py              39      2    95%   23, 53
cookiecutter/config.py           50      0   100%
cookiecutter/environment.py      19      0   100%
cookiecutter/exceptions.py       23      0   100%
cookiecutter/extensions.py       42      1    98%   46
cookiecutter/find.py             15      0   100%
cookiecutter/generate.py        133      7    95%   64-65, 95-96, 145-146, 264
cookiecutter/hooks.py            77      0   100%
cookiecutter/log.py               6      0   100%
cookiecutter/main.py             47      5    89%   123-124, 127-128, 131
cookiecutter/prompt.py           83      2    98%   134, 141
cookiecutter/replay.py           27      0   100%
cookiecutter/repository.py       45      1    98%   98
cookiecutter/utils.py            45      6    87%   63-69
cookiecutter/vcs.py              45      1    98%   75
cookiecutter/zipfile.py          38      2    95%   31, 61
-----------------------------------------------------------
TOTAL                           741     27    96%
=========================== short test summary info ============================
FAILED tests/repository/test_determine_repo_dir_finds_subdirectories.py::test_should_find_existing_cookiecutter - AssertionError: assert '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin/my-dir' == '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin'
  
  - /tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin
  + /tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutters/cookiecutter-pytest-plugin/my-dir
  ?                                                                                      +++++++
FAILED tests/repository/test_determine_repo_dir_finds_subdirectories.py::test_local_repo_typo - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.RepositoryNotFound'>
FAILED tests/repository/test_determine_repository_should_use_local_repo.py::test_finds_local_repo - AssertionError: assert 'tests/fake-repo' == '/workspace/cookiecutter/tests/fake-repo'
  
  - /workspace/cookiecutter/tests/fake-repo
  + tests/fake-repo
FAILED tests/repository/test_determine_repository_should_use_local_repo.py::test_local_repo_with_no_context_raises - assert 'A valid repository for "tests/fake-repo-bad" could not be found in the following locations:\n/workspace/cookiecutter/tests/fake-repo-bad' == 'A valid repository for "tests/fake-repo-bad" could not be found in the following locations:\ntests/fake-repo-bad\n/tmp/pytest-of-openhands/pytest-30/test_local_repo_with_no_contex0/tests/fake-repo-bad'
  
    A valid repository for "tests/fake-repo-bad" could not be found in the following locations:
  + /workspace/cookiecutter/tests/fake-repo-bad
  - tests/fake-repo-bad
  - /tmp/pytest-of-openhands/pytest-30/test_local_repo_with_no_contex0/tests/fake-repo-bad
FAILED tests/repository/test_determine_repository_should_use_local_repo.py::test_local_repo_typo - assert 'A valid repository for "tests/unknown-repo" could not be found in the following locations:\ntests/unknown-repo' == 'A valid repository for "tests/unknown-repo" could not be found in the following locations:\ntests/unknown-repo\n/tmp/pytest-of-openhands/pytest-30/test_local_repo_typo1/tests/unknown-repo'
  
    A valid repository for "tests/unknown-repo" could not be found in the following locations:
  - tests/unknown-repo
  ?                   -
  + tests/unknown-repo
  - /tmp/pytest-of-openhands/pytest-30/test_local_repo_typo1/tests/unknown-repo
FAILED tests/test_cli.py::test_cli_version[-V] - AssertionError: assert False
 +  where False = <built-in method startswith of str object at 0x7c8ac1d9abf0>('Cookiecutter')
 +    where <built-in method startswith of str object at 0x7c8ac1d9abf0> = 'main, version 2.6.0\n'.startswith
 +      where 'main, version 2.6.0\n' = <Result okay>.output
FAILED tests/test_cli.py::test_cli_version[--version] - AssertionError: assert False
 +  where False = <built-in method startswith of str object at 0x7c8ac199eba0>('Cookiecutter')
 +    where <built-in method startswith of str object at 0x7c8ac199eba0> = 'main, version 2.6.0\n'.startswith
 +      where 'main, version 2.6.0\n' = <Result okay>.output
FAILED tests/test_cli.py::test_cli_error_on_existing_output_directory - assert 0 != 0
 +  where 0 = <Result okay>.exit_code
FAILED tests/test_cli.py::test_cli - AssertionError: assert False
 +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
 +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
 +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path
FAILED tests/test_cli.py::test_cli_verbose - AssertionError: assert False
 +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
 +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
 +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path
FAILED tests/test_cli.py::test_cli_replay - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_replay_file - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_replay_generated - FileNotFoundError: [Errno 2] No such file or directory: 'tests/tmp/replay-project/README.md'
FAILED tests/test_cli.py::test_cli_exit_on_noinput_and_replay - assert 0 == 1
 +  where 0 = <Result okay>.exit_code
FAILED tests/test_cli.py::test_run_cookiecutter_on_overwrite_if_exists_and_replay[-f] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_run_cookiecutter_on_overwrite_if_exists_and_replay[--overwrite-if-exists] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_overwrite_if_exists_when_output_dir_does_not_exist[-f] - AssertionError: assert False
 +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
 +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
 +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path
FAILED tests/test_cli.py::test_cli_overwrite_if_exists_when_output_dir_does_not_exist[--overwrite-if-exists] - AssertionError: assert False
 +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
 +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
 +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path
FAILED tests/test_cli.py::test_cli_output_dir[-o] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_output_dir[--output-dir] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_help[help] - AssertionError: assert False
 +  where False = <built-in method startswith of str object at 0x7c8ac4650030>('Usage')
 +    where <built-in method startswith of str object at 0x7c8ac4650030> = ''.startswith
 +      where '' = <Result okay>.output
FAILED tests/test_cli.py::test_user_config - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_default_user_config_overwrite - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_default_user_config - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_echo_undefined_variable_error - assert 0 == 1
 +  where 0 = <Result okay>.exit_code
FAILED tests/test_cli.py::test_echo_unknown_extension_error - assert 0 == 1
 +  where 0 = <Result okay>.exit_code
FAILED tests/test_cli.py::test_local_extension - FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pytest-of-openhands/pytest-30/test_local_extension0/output/Foobar/HISTORY.rst'
FAILED tests/test_cli.py::test_cli_extra_context - AssertionError: assert False
 +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
 +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
 +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path
FAILED tests/test_cli.py::test_cli_extra_context_invalid_format - assert 0 == 2
 +  where 0 = <Result okay>.exit_code
FAILED tests/test_cli.py::test_debug_file_non_verbose - AssertionError: assert False
 +  where False = exists()
 +    where exists = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_debug_file_non_verbose0/fake-repo.log').exists
FAILED tests/test_cli.py::test_debug_file_verbose - AssertionError: assert False
 +  where False = exists()
 +    where exists = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_debug_file_verbose0/fake-repo.log').exists
FAILED tests/test_cli.py::test_debug_list_installed_templates - AssertionError: assert '1 installed templates:' in ''
 +  where '' = <Result okay>.output
FAILED tests/test_cli.py::test_debug_list_installed_templates_failure - AssertionError: assert 'Error: Cannot list installed templates.' in ''
 +  where '' = <Result okay>.output
FAILED tests/test_cli.py::test_directory_repo - AssertionError: assert False
 +  where False = <function isdir at 0x7c8ac455dfc0>('fake-project')
 +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
 +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path
FAILED tests/test_cli.py::test_cli_accept_hooks[-o---accept-hooks=yes-None-True] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_accept_hooks[-o---accept-hooks=no-None-False] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_accept_hooks[-o---accept-hooks=ask-yes-True] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_accept_hooks[-o---accept-hooks=ask-no-False] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=yes-None-True] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=no-None-False] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=ask-yes-True] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=ask-no-False] - AssertionError: Expected 'cookiecutter' to be called once. Called 0 times.
FAILED tests/test_cli.py::test_cli_with_json_decoding_error - assert 0 != 0
 +  where 0 = <Result okay>.exit_code
FAILED tests/test_cli.py::test_cli_with_pre_prompt_hook - AssertionError: assert False
 +  where False = <function isdir at 0x7c8ac455dfc0>('inputfake-project')
 +    where <function isdir at 0x7c8ac455dfc0> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isdir
 +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path
FAILED tests/test_cli.py::test_cli_with_pre_prompt_hook_fail - assert 0 == 1
 +  where 0 = <Result okay>.exit_code
FAILED tests/test_cookiecutter_invocation.py::test_should_invoke_main - subprocess.CalledProcessError: Command '['/usr/bin/python', '-m', 'cookiecutter.cli', 'tests/fake-repo-tmpl', '--no-input']' returned non-zero exit status 1.
FAILED tests/test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_return_project_dir[tests/fake-repo-pre/] - AssertionError: assert False
 +  where False = <function isfile at 0x7c8ac455df30>('fake-project/README.rst')
 +    where <function isfile at 0x7c8ac455df30> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isfile
 +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path
FAILED tests/test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_return_project_dir[tests/fake-repo-pre] - AssertionError: assert False
 +  where False = <function isfile at 0x7c8ac455df30>('fake-project/README.rst')
 +    where <function isfile at 0x7c8ac455df30> = <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'>.isfile
 +      where <module 'posixpath' from '/usr/lib/python3.10/posixpath.py'> = os.path
FAILED tests/test_cookiecutter_local_no_input.py::test_cookiecutter_templated_context - cookiecutter.exceptions.OutputDirExistsException: Output directory {{ cookiecutter.project_name|lower|replace(' ', '-') }} already exists
FAILED tests/test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_return_rendered_file - AssertionError: assert 'fake-project' == '/workspace/cookiecutter/fake-project'
  
  - /workspace/cookiecutter/fake-project
  + fake-project
FAILED tests/test_cookiecutter_local_no_input.py::test_cookiecutter_dict_values_in_context - AssertionError: assert 'fake-project-dict' == '/workspace/cookiecutter/fake-project-dict'
  
  - /workspace/cookiecutter/fake-project-dict
  + fake-project-dict
FAILED tests/test_cookiecutter_local_no_input.py::test_cookiecutter_template_cleanup - cookiecutter.exceptions.OutputDirExistsException: Output directory {{ cookiecutter.project_name|lower|replace(' ', '-') }} already exists
FAILED tests/test_cookiecutter_local_with_input.py::test_cookiecutter_local_with_input - TypeError: test_cookiecutter_local_with_input.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'
FAILED tests/test_cookiecutter_local_with_input.py::test_cookiecutter_input_extra_context - TypeError: test_cookiecutter_input_extra_context.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'
FAILED tests/test_cookiecutter_nested_templates.py::test_cookiecutter_nested_templates[fake-nested-templates-fake-project] - AssertionError: assert PosixPath('/tmp/tmpr3z7ekd5') == '/workspace/cookiecutter/tests/fake-nested-templates/fake-project'
FAILED tests/test_cookiecutter_nested_templates.py::test_cookiecutter_nested_templates[fake-nested-templates-old-style-fake-package] - AssertionError: assert PosixPath('/tmp/tmpxcvyjq3x') == '/workspace/cookiecutter/tests/fake-nested-templates-old-style/fake-package'
FAILED tests/test_custom_extensions_in_hooks.py::test_hook_with_extension[pre_gen_hook] - cookiecutter.exceptions.FailedHookException: Hook script failed, might be an empty file or missing a shebang
FAILED tests/test_custom_extensions_in_hooks.py::test_hook_with_extension[post_gen_hook] - cookiecutter.exceptions.FailedHookException: Hook script failed, might be an empty file or missing a shebang
FAILED tests/test_default_extensions.py::test_jinja2_time_extension - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_default_extensions.py::test_jinja2_slugify_extension - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_default_extensions.py::test_jinja2_uuid_extension - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_generate_copy_without_render.py::test_generate_copy_without_render_extensions - AssertionError: assert 'test_copy_without_render-not-rendered' in []
FAILED tests/test_generate_copy_without_render_override.py::test_generate_copy_without_render_extensions - AssertionError: assert 'test_copy_without_render-not-rendered' in []
FAILED tests/test_generate_file.py::test_generate_file_with_false_condition - IsADirectoryError: [Errno 21] Is a directory: 'tests/files'
FAILED tests/test_generate_file.py::test_generate_file_verbose_template_syntax_error - assert None
 +  where None = <built-in method match of re.Pattern object at 0x56b4e85212f0>('Missing end of comment tag')
 +    where <built-in method match of re.Pattern object at 0x56b4e85212f0> = re.compile('Missing end of comment tag\n {2}File "(.[/\\\\])*tests[/\\\\]files[/\\\\]syntax_error.txt", line 1\n {4}I eat {{ syntax_error }} {# this comment is not closed}').match
 +    and   'Missing end of comment tag' = str(TemplateSyntaxError('Missing end of comment tag'))
 +      where TemplateSyntaxError('Missing end of comment tag') = <ExceptionInfo TemplateSyntaxError('Missing end of comment tag') tblen=6>.value
FAILED tests/test_generate_file.py::test_generate_file_does_not_translate_crlf_newlines_to_lf - AssertionError: assert 'newline is CRLF\n' == 'newline is CRLF\r\n'
  
  - newline is CRLF
  ?                -
  + newline is CRLF
FAILED tests/test_generate_files.py::test_generate_files - AssertionError: assert 'I eat pizzä' == 'I eat pizzä\n'
  
  - I eat pizzä
  ?            -
  + I eat pizzä
FAILED tests/test_generate_files.py::test_generate_files_with_trailing_newline_forced_to_linux_by_context - AssertionError: assert 'newline is LF\n' == 'newline is LF\r\n'
  
  - newline is LF
  ?              -
  + newline is LF
FAILED tests/test_generate_files.py::test_generate_files_with_windows_newline - AssertionError: assert 'newline is CRLF\n' == 'newline is CRLF\r\n'
  
  - newline is CRLF
  ?                -
  + newline is CRLF
FAILED tests/test_generate_files.py::test_generate_files_binaries - AssertionError: assert False
 +  where False = is_binary('/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files/.DS_Store')
 +    where '/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files/.DS_Store' = str(PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files/.DS_Store'))
 +      where PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files/.DS_Store') = Path(PosixPath('/tmp/pytest-of-openhands/pytest-30/test_generate_files_binaries0/inputbinary_files'), '.DS_Store')
FAILED tests/test_generate_files.py::test_generate_files_permissions - assert 33261 == 33188
FAILED tests/test_generate_files.py::test_generate_files_with_overwrite_if_exists_with_skip_if_file_exists - AssertionError: assert 'I eat pizzä' == 'temp'
  
  - temp
  + I eat pizzä
FAILED tests/test_generate_files.py::test_generate_files_with_overwrite_if_exists - AssertionError: assert 'I eat pizzä' == 'I eat pizzä\n'
  
  - I eat pizzä
  ?            -
  + I eat pizzä
FAILED tests/test_generate_files.py::test_raise_undefined_variable_file_name - jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'
FAILED tests/test_generate_files.py::test_raise_undefined_variable_file_name_existing_project - jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'
FAILED tests/test_generate_files.py::test_raise_undefined_variable_file_content - TypeError: UndefinedVariableInTemplate.__init__() missing 2 required positional arguments: 'error' and 'context'
FAILED tests/test_generate_files.py::test_raise_undefined_variable_dir_name - jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'
FAILED tests/test_generate_files.py::test_keep_project_dir_on_failure - jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'
FAILED tests/test_generate_files.py::test_raise_undefined_variable_dir_name_existing_project - jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'foobar'
FAILED tests/test_generate_files.py::test_raise_undefined_variable_project_dir - jinja2.exceptions.UndefinedError: 'cookiecutter' is undefined
FAILED tests/test_generate_hooks.py::test_ignore_hooks_dirs - FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-pyhooks/tests/test-pyhooks/inputpyhooks/tmpy8xnvf58.py'
FAILED tests/test_generate_hooks.py::test_run_python_hooks - FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-pyhooks/tests/test-pyhooks/inputpyhooks/tmpq4xplwjd.py'
FAILED tests/test_generate_hooks.py::test_run_python_hooks_cwd - FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-pyhooks/inputpyhooks/tmpqu5l01fi.py'
FAILED tests/test_generate_hooks.py::test_empty_hooks - FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-shellhooks-empty/inputshellhooks/tmpcneofrpt.sh'
FAILED tests/test_generate_hooks.py::test_oserror_hooks - FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-shellhooks-empty/inputshellhooks/tmp7ybcmt71.sh'
FAILED tests/test_generate_hooks.py::test_run_failing_hook_removes_output_directory - FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-hooks/inputhooks/tmpip2eeah7.py'
FAILED tests/test_generate_hooks.py::test_run_failing_hook_preserves_existing_output_directory - FileNotFoundError: [Errno 2] No such file or directory: '/workspace/cookiecutter/tests/test-hooks/inputhooks/tmpethnonol.py'
FAILED tests/test_generate_hooks.py::test_deprecate_run_hook_from_repo_dir - Failed: DID NOT WARN. No warnings of type (<class 'DeprecationWarning'>, <class 'PendingDeprecationWarning'>, <class 'FutureWarning'>) were emitted.
 Emitted warnings: [].
FAILED tests/test_log.py::test_info_stdout_logging - AttributeError: 'NoneType' object has no attribute 'handlers'
FAILED tests/test_log.py::test_debug_stdout_logging - AttributeError: 'NoneType' object has no attribute 'handlers'
FAILED tests/test_log.py::test_debug_file_logging - AttributeError: 'NoneType' object has no attribute 'handlers'
FAILED tests/test_main.py::test_replay_dump_template_name - AssertionError: expected call not found.
Expected: dump('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
Actual: dump('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '', OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))]))

pytest introspection follows:

Args:
assert ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '', OrderedDict([('cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')])), ('_cookiecutter', OrderedDict([('full_name', 'Audrey Roy'), ('email', 'audreyr@gmail.com'), ('github_username', 'audreyr'), ('project_name', 'Fake Project Templated'), ('repo_name', "{{ cookiecutter.project_name|lower|replace(' ', '-') }}"), ('project_short_description', 'This is a fake project.'), ('release_date', '2013-07-28'), ('year', '2013'), ('version', '0.1')]))])) == ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl', <ANY>)
  
  At index 1 diff: '' != 'fake-repo-tmpl'
  
  Full diff:
    (
        '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay',
  -     'fake-repo-tmpl',
  -     <ANY>,
  +     '',
  +     OrderedDict({
  +         '_cookiecutter': OrderedDict({
  +             'email': 'audreyr@gmail.com',
  +             'full_name': 'Audrey Roy',
  +             'github_username': 'audreyr',
  +             'project_name': 'Fake Project Templated',
  +             'project_short_description': 'This is a fake project.',
  +             'release_date': '2013-07-28',
  +             'repo_name': "{{ cookiecutter.project_name|lower|replace(' ', '-') }}",
  +             'version': '0.1',
  +             'year': '2013',
  +         }),
  +         'cookiecutter': OrderedDict({
  +             'email': 'audreyr@gmail.com',
  +             'full_name': 'Audrey Roy',
  +             'github_username': 'audreyr',
  +             'project_name': 'Fake Project Templated',
  +             'project_short_description': 'This is a fake project.',
  +             'release_date': '2013-07-28',
  +             'repo_name': "{{ cookiecutter.project_name|lower|replace(' ', '-') }}",
  +             'version': '0.1',
  +             'year': '2013',
  +         }),
  +     }),
    )
FAILED tests/test_main.py::test_replay_load_template_name - AssertionError: expected call not found.
Expected: load('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
Actual: load('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '')

pytest introspection follows:

Args:
assert ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', '') == ('/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay', 'fake-repo-tmpl')
  
  At index 1 diff: '' != 'fake-repo-tmpl'
  
  Full diff:
    (
        '/tmp/pytest-of-openhands/pytest-30/user_dir0/cookiecutter_replay',
  -     'fake-repo-tmpl',
  +     '',
    )
FAILED tests/test_main.py::test_custom_replay_file - AssertionError: expected call not found.
Expected: load('.', 'custom-replay-file')
Actual: load('.', './custom-replay-file')

pytest introspection follows:

Args:
assert ('.', './custom-replay-file') == ('.', 'custom-replay-file')
  
  At index 1 diff: './custom-replay-file' != 'custom-replay-file'
  
  Full diff:
    (
        '.',
  -     'custom-replay-file',
  +     './custom-replay-file',
  ?      ++
    )
FAILED tests/test_output_folder.py::test_output_folder - FileNotFoundError: [Errno 2] No such file or directory: 'output_folder/something.txt'
FAILED tests/test_pre_prompt_hooks.py::test_run_pre_prompt_python_hook - cookiecutter.exceptions.FailedHookException: Hook script failed, might be an empty file or missing a shebang
FAILED tests/test_pre_prompt_hooks.py::test_run_pre_prompt_python_hook_fail - AssertionError: assert 'Pre-Prompt Hook script failed' in 'Hook script failed, might be an empty file or missing a shebang'
 +  where 'Hook script failed, might be an empty file or missing a shebang' = str(FailedHookException('Hook script failed, might be an empty file or missing a shebang'))
 +    where FailedHookException('Hook script failed, might be an empty file or missing a shebang') = <ExceptionInfo FailedHookException('Hook script failed, might be an empty file or missing a shebang') tblen=4>.value
FAILED tests/test_prompt.py::TestRenderVariable::test_convert_to_str[1-1] - AssertionError: assert 1 == '1'
FAILED tests/test_prompt.py::TestRenderVariable::test_convert_to_str_complex_variables[raw_var0-rendered_var0] - AssertionError: assert {1: True, 'foo': False} == {'1': True, 'foo': False}
  
  Common items:
  {'foo': False}
  Left contains 1 more item:
  {1: True}
  Right contains 1 more item:
  {'1': True}
  
  Full diff:
    {
  -     '1': True,
  ?     - -
  +     1: True,
        'foo': False,
    }
FAILED tests/test_prompt.py::TestRenderVariable::test_convert_to_str_complex_variables[raw_var1-rendered_var1] - AssertionError: assert {'{{cookiecutter.project}}': ['foo', 1], 'bar': False} == {'foobar': ['foo', '1'], 'bar': False}
  
  Common items:
  {'bar': False}
  Left contains 1 more item:
  {'{{cookiecutter.project}}': ['foo', 1]}
  Right contains 1 more item:
  {'foobar': ['foo', '1']}
  
  Full diff:
    {
        'bar': False,
  -     'foobar': [
  +     '{{cookiecutter.project}}': [
            'foo',
  -         '1',
  ?         - -
  +         1,
        ],
    }
FAILED tests/test_prompt.py::TestPrompt::test_prompt_for_config[ASCII default prompt/input] - TypeError: TestPrompt.test_prompt_for_config.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'
FAILED tests/test_prompt.py::TestPrompt::test_prompt_for_config[Unicode default prompt/input] - TypeError: TestPrompt.test_prompt_for_config.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'
FAILED tests/test_prompt.py::TestPrompt::test_prompt_for_config_with_human_prompts[ASCII default prompt/input] - TypeError: TestPrompt.test_prompt_for_config_with_human_prompts.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'
FAILED tests/test_prompt.py::TestPrompt::test_prompt_for_config_with_human_choices[context0] - AssertionError: assert {'cookiecutter': OrderedDict([('full_name', 'Your Name'), ('check', 'yes'), ('__prompts__', {'check': 'Checking'})])} == {'full_name': 'Your Name', 'check': 'yes'}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('full_name', 'Your Name'),
                                ('check', 'yes'),
                                ('__prompts__', {'check': 'Checking'})])}
  Right contains 2 more items:
  {'check': 'yes', 'full_name': 'Your Name'}
  
  Full diff:
    {
  +     'cookiecutter': OrderedDict({
  +         '__prompts__': {
  +             'check': 'Checking',
  +         },
  -     'check': 'yes',
  +         'check': 'yes',
  ? ++++
  -     'full_name': 'Your Name',
  +         'full_name': 'Your Name',
  ? ++++
  +     }),
    }
FAILED tests/test_prompt.py::TestPrompt::test_prompt_for_config_with_human_choices[context1] - AssertionError: assert {'cookiecutter': OrderedDict([('full_name', 'Your Name'), ('check', 'yes'), ('__prompts__', {'full_name': 'Name please', 'check': {'__prompt__': 'Checking', 'yes': 'Yes', 'no': 'No'}})])} == {'full_name': 'Your Name', 'check': 'yes'}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('full_name', 'Your Name'),
                                ('check', 'yes'),
                                ('__prompts__',
                                 {'check': {'__prompt__': 'Checking',
                                            'no': 'No',
                                            'yes': 'Yes'},
                                  'full_name': 'Name please'})])}
  Right contains 2 more items:
  {'check': 'yes', 'full_name': 'Your Name'}
  
  Full diff:
    {
  +     'cookiecutter': OrderedDict({
  +         '__prompts__': {
  +             'check': {
  +                 '__prompt__': 'Checking',
  +                 'no': 'No',
  +                 'yes': 'Yes',
  +             },
  +             'full_name': 'Name please',
  +         },
  -     'check': 'yes',
  +         'check': 'yes',
  ? ++++
  -     'full_name': 'Your Name',
  +         'full_name': 'Your Name',
  ? ++++
  +     }),
    }
FAILED tests/test_prompt.py::TestPrompt::test_prompt_for_config_with_human_choices[context2] - AssertionError: assert {'cookiecutter': OrderedDict([('full_name', 'Your Name'), ('check', 'yes'), ('__prompts__', {'full_name': 'Name please', 'check': {'no': 'No'}})])} == {'full_name': 'Your Name', 'check': 'yes'}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('full_name', 'Your Name'),
                                ('check', 'yes'),
                                ('__prompts__',
                                 {'check': {'no': 'No'},
                                  'full_name': 'Name please'})])}
  Right contains 2 more items:
  {'check': 'yes', 'full_name': 'Your Name'}
  
  Full diff:
    {
  +     'cookiecutter': OrderedDict({
  +         '__prompts__': {
  +             'check': {
  +                 'no': 'No',
  +             },
  +             'full_name': 'Name please',
  +         },
  -     'check': 'yes',
  +         'check': 'yes',
  ? ++++
  -     'full_name': 'Your Name',
  +         'full_name': 'Your Name',
  ? ++++
  +     }),
    }
FAILED tests/test_prompt.py::TestPrompt::test_prompt_for_config_dict - TypeError: TestPrompt.test_prompt_for_config_dict.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'
FAILED tests/test_prompt.py::TestPrompt::test_should_render_dict - AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'), ('details', {'{{cookiecutter.project_name}}': '{{cookiecutter.project_name}}'})])} == {'project_name': 'Slartibartfast', 'details': {'Slartibartfast': 'Slartibartfast'}}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'),
                                ('details',
                                 {'{{cookiecutter.project_name}}': '{{cookiecutter.project_name}}'})])}
  Right contains 2 more items:
  {'details': {'Slartibartfast': 'Slartibartfast'},
   'project_name': 'Slartibartfast'}
  
  Full diff:
    {
  +     'cookiecutter': OrderedDict({
  -     'details': {
  +         'details': {
  ? ++++
  -         'Slartibartfast': 'Slartibartfast',
  +             '{{cookiecutter.project_name}}': '{{cookiecutter.project_name}}',
  -     },
  +         },
  ? ++++
  -     'project_name': 'Slartibartfast',
  +         'project_name': 'Slartibartfast',
  ? ++++
  +     }),
    }
FAILED tests/test_prompt.py::TestPrompt::test_should_render_deep_dict - AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'), ('details', {'key': 'value', 'integer_key': 37, 'other_name': '{{cookiecutter.project_name}}', 'dict_key': {'deep_key': 'deep_value', 'deep_integer': 42, 'deep_other_name': '{{cookiecutter.project_name}}', 'deep_list': ['deep value 1', '{{cookiecutter.project_name}}', 'deep value 3']}, 'list_key': ['value 1', '{{cookiecutter.project_name}}', 'value 3']})])} == {'project_name': 'Slartibartfast', 'details': {'key': 'value', 'integer_key': '37', 'other_name': 'Slartibartfast', 'dict_key': {'deep_key': 'deep_value', 'deep_integer': '42', 'deep_other_name': 'Slartibartfast', 'deep_list': ['deep value 1', 'Slartibartfast', 'deep value 3']}, 'list_key': ['value 1', 'Slartibartfast', 'value 3']}}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'),
                                ('details',
                                 {'dict_key': {'deep_integer': 42,
                                               'deep_key': 'deep_value',
                                               'deep_list': ['deep value 1',
                                                             '{{cookiecutter.project_name}}',
                                                             'deep value 3'],
                                               'deep_other_name': '{{cookiecutter.project_name}}'},
                                  'integer_key': 37,
                                  'key': 'value',
                                  'list_key': ['value 1',
                                               '{{cookiecutter.project_name}}',
                                               'value 3'],
                                  'other_name': '{{cookiecutter.project_name}}'})])}
  Right contains 2 more items:
  {'details': {'dict_key': {'deep_integer': '42',
                            'deep_key': 'deep_value',
                            'deep_list': ['deep value 1',
                                          'Slartibartfast',
                                          'deep value 3'],
                            'deep_other_name': 'Slartibartfast'},
               'integer_key': '37',
               'key': 'value',
               'list_key': ['value 1', 'Slartibartfast', 'value 3'],
               'other_name': 'Slartibartfast'},
   'project_name': 'Slartibartfast'}
  
  Full diff:
    {
  +     'cookiecutter': OrderedDict({
  -     'details': {
  +         'details': {
  ? ++++
  -         'dict_key': {
  +             'dict_key': {
  ? ++++
  -             'deep_integer': '42',
  ?                             -  -
  +                 'deep_integer': 42,
  ? ++++
  -             'deep_key': 'deep_value',
  +                 'deep_key': 'deep_value',
  ? ++++
  -             'deep_list': [
  +                 'deep_list': [
  ? ++++
  -                 'deep value 1',
  +                     'deep value 1',
  ? ++++
  -                 'Slartibartfast',
  +                     '{{cookiecutter.project_name}}',
  -                 'deep value 3',
  +                     'deep value 3',
  ? ++++
  +                 ],
  +                 'deep_other_name': '{{cookiecutter.project_name}}',
  +             },
  +             'integer_key': 37,
  +             'key': 'value',
  +             'list_key': [
  +                 'value 1',
  +                 '{{cookiecutter.project_name}}',
  +                 'value 3',
                ],
  -             'deep_other_name': 'Slartibartfast',
  +             'other_name': '{{cookiecutter.project_name}}',
            },
  -         'integer_key': '37',
  -         'key': 'value',
  -         'list_key': [
  -             'value 1',
  -             'Slartibartfast',
  -             'value 3',
  -         ],
  -         'other_name': 'Slartibartfast',
  -     },
  -     'project_name': 'Slartibartfast',
  +         'project_name': 'Slartibartfast',
  ? ++++
  +     }),
    }
FAILED tests/test_prompt.py::TestPrompt::test_should_render_deep_dict_with_human_prompts - AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'), ('details', {'key': 'value', 'integer_key': 37, 'other_name': '{{cookiecutter.project_name}}', 'dict_key': {'deep_key': 'deep_value'}}), ('__prompts__', {'project_name': 'Project name'})])} == {'project_name': 'Slartibartfast', 'details': {'key': 'value', 'integer_key': '37', 'other_name': 'Slartibartfast', 'dict_key': {'deep_key': 'deep_value'}}}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'),
                                ('details',
                                 {'dict_key': {'deep_key': 'deep_value'},
                                  'integer_key': 37,
                                  'key': 'value',
                                  'other_name': '{{cookiecutter.project_name}}'}),
                                ('__prompts__',
                                 {'project_name': 'Project name'})])}
  Right contains 2 more items:
  {'details': {'dict_key': {'deep_key': 'deep_value'},
               'integer_key': '37',
               'key': 'value',
               'other_name': 'Slartibartfast'},
   'project_name': 'Slartibartfast'}
  
  Full diff:
    {
  -     'details': {
  -         'dict_key': {
  -             'deep_key': 'deep_value',
  +     'cookiecutter': OrderedDict({
  +         '__prompts__': {
  +             'project_name': 'Project name',
            },
  +         'details': {
  +             'dict_key': {
  +                 'deep_key': 'deep_value',
  +             },
  -         'integer_key': '37',
  ?                        -  -
  +             'integer_key': 37,
  ? ++++
  -         'key': 'value',
  +             'key': 'value',
  ? ++++
  -         'other_name': 'Slartibartfast',
  +             'other_name': '{{cookiecutter.project_name}}',
  -     },
  +         },
  ? ++++
  -     'project_name': 'Slartibartfast',
  +         'project_name': 'Slartibartfast',
  ? ++++
  +     }),
    }
FAILED tests/test_prompt.py::TestPrompt::test_internal_use_no_human_prompts - AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'), ('__prompts__', {})])} == {'project_name': 'Slartibartfast'}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('project_name', 'Slartibartfast'),
                                ('__prompts__', {})])}
  Right contains 1 more item:
  {'project_name': 'Slartibartfast'}
  
  Full diff:
    {
  +     'cookiecutter': OrderedDict({
  +         '__prompts__': {},
  -     'project_name': 'Slartibartfast',
  +         'project_name': 'Slartibartfast',
  ? ++++
  +     }),
    }
FAILED tests/test_prompt.py::TestPrompt::test_prompt_for_templated_config - TypeError: TestPrompt.test_prompt_for_templated_config.<locals>.<lambda>() missing 2 required positional arguments: 'prompts' and 'prefix'
FAILED tests/test_prompt.py::TestPrompt::test_dont_prompt_for_private_context_var - AssertionError: assert {'cookiecutter': OrderedDict([('_copy_without_render', ['*.html'])])} == {'_copy_without_render': ['*.html']}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('_copy_without_render', ['*.html'])])}
  Right contains 1 more item:
  {'_copy_without_render': ['*.html']}
  
  Full diff:
    {
  +     'cookiecutter': OrderedDict({
  -     '_copy_without_render': [
  +         '_copy_without_render': [
  ? ++++
  -         '*.html',
  +             '*.html',
  ? ++++
  +         ],
  -     ],
  ?     ^
  +     }),
  ?     ^^
    }
FAILED tests/test_prompt.py::TestPrompt::test_should_render_private_variables_with_two_underscores - AssertionError: assert {'cookiecutter': OrderedDict([('foo', 'Hello world'), ('bar', 123), ('rendered_foo', '{{ cookiecutter.foo|lower }}'), ('rendered_bar', 123), ('_hidden_foo', '{{ cookiecutter.foo|lower }}'), ('_hidden_bar', 123), ('__rendered_hidden_foo', '{{ cookiecutter.foo|lower }}'), ('__rendered_hidden_bar', 123)])} == OrderedDict([('foo', 'Hello world'), ('bar', '123'), ('rendered_foo', 'hello world'), ('rendered_bar', '123'), ('_hidden_foo', '{{ cookiecutter.foo|lower }}'), ('_hidden_bar', 123), ('__rendered_hidden_foo', 'hello world'), ('__rendered_hidden_bar', '123')])
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('foo', 'Hello world'),
                                ('bar', 123),
                                ('rendered_foo', '{{ cookiecutter.foo|lower }}'),
                                ('rendered_bar', 123),
                                ('_hidden_foo', '{{ cookiecutter.foo|lower }}'),
                                ('_hidden_bar', 123),
                                ('__rendered_hidden_foo',
                                 '{{ cookiecutter.foo|lower }}'),
                                ('__rendered_hidden_bar', 123)])}
  Right contains 8 more items:
  {'__rendered_hidden_bar': '123',
   '__rendered_hidden_foo': 'hello world',
   '_hidden_bar': 123,
   '_hidden_foo': '{{ cookiecutter.foo|lower }}',
   'bar': '123',
   'foo': 'Hello world',
   'rendered_bar': '123',
   'rendered_foo': 'hello world'}
  
  Full diff:
  - OrderedDict({
  + {
  +     'cookiecutter': OrderedDict({
  -     '__rendered_hidden_bar': '123',
  ?                              -   -
  +         '__rendered_hidden_bar': 123,
  ? ++++
  -     '__rendered_hidden_foo': 'hello world',
  +         '__rendered_hidden_foo': '{{ cookiecutter.foo|lower }}',
  -     '_hidden_bar': 123,
  +         '_hidden_bar': 123,
  ? ++++
  -     '_hidden_foo': '{{ cookiecutter.foo|lower }}',
  +         '_hidden_foo': '{{ cookiecutter.foo|lower }}',
  ? ++++
  -     'bar': '123',
  ?            -   -
  +         'bar': 123,
  ? ++++
  -     'foo': 'Hello world',
  +         'foo': 'Hello world',
  ? ++++
  -     'rendered_bar': '123',
  ?                     -   -
  +         'rendered_bar': 123,
  ? ++++
  -     'rendered_foo': 'hello world',
  - })
  +         'rendered_foo': '{{ cookiecutter.foo|lower }}',
  +     }),
  + }
FAILED tests/test_prompt.py::TestPrompt::test_should_not_render_private_variables - AssertionError: assert {'cookiecutter': OrderedDict([('project_name', 'Skip render'), ('_skip_jinja_template', '{{cookiecutter.project_name}}'), ('_skip_float', 123.25), ('_skip_integer', 123), ('_skip_boolean', True), ('_skip_nested', True)])} == {'project_name': 'Skip render', '_skip_jinja_template': '{{cookiecutter.project_name}}', '_skip_float': 123.25, '_skip_integer': 123, '_skip_boolean': True, '_skip_nested': True}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('project_name', 'Skip render'),
                                ('_skip_jinja_template',
                                 '{{cookiecutter.project_name}}'),
                                ('_skip_float', 123.25),
                                ('_skip_integer', 123),
                                ('_skip_boolean', True),
                                ('_skip_nested', True)])}
  Right contains 6 more items:
  {'_skip_boolean': True,
   '_skip_float': 123.25,
   '_skip_integer': 123,
   '_skip_jinja_template': '{{cookiecutter.project_name}}',
   '_skip_nested': True,
   'project_name': 'Skip render'}
  
  Full diff:
    {
  +     'cookiecutter': OrderedDict({
  -     '_skip_boolean': True,
  +         '_skip_boolean': True,
  ? ++++
  -     '_skip_float': 123.25,
  +         '_skip_float': 123.25,
  ? ++++
  -     '_skip_integer': 123,
  +         '_skip_integer': 123,
  ? ++++
  -     '_skip_jinja_template': '{{cookiecutter.project_name}}',
  +         '_skip_jinja_template': '{{cookiecutter.project_name}}',
  ? ++++
  -     '_skip_nested': True,
  +         '_skip_nested': True,
  ? ++++
  -     'project_name': 'Skip render',
  +         'project_name': 'Skip render',
  ? ++++
  +     }),
    }
FAILED tests/test_prompt.py::TestReadUserChoice::test_should_invoke_read_user_choice - AssertionError: assert False
 +  where False = <MagicMock name='prompt_choice_for_config' id='136935400333056'>.called
FAILED tests/test_prompt.py::TestReadUserChoice::test_should_invoke_read_user_variable - AssertionError: expected call not found.
Expected: read_user_variable('full_name', 'Your Name', {}, '  [dim][1/1][/] ')
Actual: read_user_variable('full_name', 'Your Name')

pytest introspection follows:

Args:
assert ('full_name', 'Your Name') == ('full_name', 'Your Name', {}, '  [dim][1/1][/] ')
  
  Right contains 2 more items, first extra item: {}
  
  Full diff:
    (
        'full_name',
        'Your Name',
  -     {},
  -     '  [dim][1/1][/] ',
    )
FAILED tests/test_prompt.py::TestReadUserChoice::test_should_render_choices - AssertionError: expected call not found.
Expected: read_user_variable('project_name', 'A New Project', {}, '  [dim][1/2][/] ')
Actual: read_user_variable('project_name', 'A New Project')

pytest introspection follows:

Args:
assert ('project_name', 'A New Project') == ('project_name', 'A New Project', {}, '  [dim][1/2][/] ')
  
  Right contains 2 more items, first extra item: {}
  
  Full diff:
    (
        'project_name',
        'A New Project',
  -     {},
  -     '  [dim][1/2][/] ',
    )
FAILED tests/test_prompt.py::TestPromptChoiceForConfig::test_should_return_first_option_if_no_input - AssertionError: assert 'landscape' == None
FAILED tests/test_prompt.py::TestPromptChoiceForConfig::test_should_read_user_choice - AssertionError: Expected 'read_user_choice' to be called once. Called 0 times.
FAILED tests/test_prompt.py::TestReadUserYesNo::test_should_invoke_read_user_yes_no[True] - AssertionError: expected call not found.
Expected: read_user_yes_no('run_as_docker', True, {}, '  [dim][1/1][/] ')
Actual: read_user_yes_no('run_as_docker', True)

pytest introspection follows:

Args:
assert ('run_as_docker', True) == ('run_as_docker', True, {}, '  [dim][1/1][/] ')
  
  Right contains 2 more items, first extra item: {}
  
  Full diff:
    (
        'run_as_docker',
        True,
  -     {},
  -     '  [dim][1/1][/] ',
    )
FAILED tests/test_prompt.py::TestReadUserYesNo::test_should_invoke_read_user_yes_no[False] - AssertionError: expected call not found.
Expected: read_user_yes_no('run_as_docker', False, {}, '  [dim][1/1][/] ')
Actual: read_user_yes_no('run_as_docker', False)

pytest introspection follows:

Args:
assert ('run_as_docker', False) == ('run_as_docker', False, {}, '  [dim][1/1][/] ')
  
  Right contains 2 more items, first extra item: {}
  
  Full diff:
    (
        'run_as_docker',
        False,
  -     {},
  -     '  [dim][1/1][/] ',
    )
FAILED tests/test_prompt.py::TestReadUserYesNo::test_boolean_parameter_no_input - AssertionError: assert {'cookiecutter': OrderedDict([('run_as_docker', True)])} == {'run_as_docker': True}
  
  Left contains 1 more item:
  {'cookiecutter': OrderedDict([('run_as_docker', True)])}
  Right contains 1 more item:
  {'run_as_docker': True}
  
  Full diff:
    {
  +     'cookiecutter': OrderedDict({
  -     'run_as_docker': True,
  +         'run_as_docker': True,
  ? ++++
  +     }),
    }
FAILED tests/test_prompt.py::test_undefined_variable[Undefined variable in cookiecutter dict] - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UndefinedVariableInTemplate'>
FAILED tests/test_prompt.py::test_undefined_variable[Undefined variable in cookiecutter dict with choices] - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UndefinedVariableInTemplate'>
FAILED tests/test_prompt.py::test_undefined_variable[Undefined variable in cookiecutter dict with dict_key] - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UndefinedVariableInTemplate'>
FAILED tests/test_prompt.py::test_undefined_variable[Undefined variable in cookiecutter dict with key_value] - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UndefinedVariableInTemplate'>
FAILED tests/test_prompt.py::test_cookiecutter_nested_templates[fake-nested-templates-fake-project] - AssertionError: assert None == '/workspace/cookiecutter/tests/fake-nested-templates/fake-project'
FAILED tests/test_prompt.py::test_cookiecutter_nested_templates[fake-nested-templates-old-style-fake-package] - AssertionError: assert None == '/workspace/cookiecutter/tests/fake-nested-templates-old-style/fake-package'
FAILED tests/test_prompt.py::test_cookiecutter_nested_templates_invalid_paths[] - Failed: DID NOT RAISE <class 'ValueError'>
FAILED tests/test_prompt.py::test_cookiecutter_nested_templates_invalid_paths[/tmp] - Failed: DID NOT RAISE <class 'ValueError'>
FAILED tests/test_prompt.py::test_cookiecutter_nested_templates_invalid_paths[/foo] - Failed: DID NOT RAISE <class 'ValueError'>
FAILED tests/test_prompt.py::test_prompt_should_ask_and_rm_repo_dir - AssertionError: assert False
 +  where False = <MagicMock name='read_user_yes_no' id='136935400181856'>.called
FAILED tests/test_prompt.py::test_prompt_should_ask_and_exit_on_user_no_answer - AssertionError: assert False
 +  where False = <MagicMock name='read_user_yes_no' id='136935410483552'>.called
FAILED tests/test_prompt.py::test_prompt_should_ask_and_rm_repo_file - assert False
 +  where False = <function read_user_yes_no at 0x7c8ac1463a30>.called
FAILED tests/test_prompt.py::test_prompt_should_ask_and_keep_repo_on_no_reuse - Failed: DID NOT RAISE <class 'SystemExit'>
FAILED tests/test_prompt.py::test_prompt_should_ask_and_keep_repo_on_reuse - assert False
 +  where False = <function read_user_yes_no at 0x7c8ac1463d90>.called
FAILED tests/test_prompt.py::test_prompt_should_not_ask_if_no_input_and_rm_repo_dir - AssertionError: assert not True
 +  where True = exists()
 +    where exists = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_not_ask_if_0/repo').exists
FAILED tests/test_prompt.py::test_prompt_should_not_ask_if_no_input_and_rm_repo_file - AssertionError: assert not True
 +  where True = exists()
 +    where exists = PosixPath('/tmp/pytest-of-openhands/pytest-30/test_prompt_should_not_ask_if_1/repo.zip').exists
FAILED tests/test_read_user_choice.py::test_click_invocation[1-hello] - AssertionError: assert '1' == 'hello'
  
  - hello
  + 1
FAILED tests/test_read_user_choice.py::test_click_invocation[2-world] - AssertionError: assert '2' == 'world'
  
  - world
  + 2
FAILED tests/test_read_user_choice.py::test_click_invocation[3-foo] - AssertionError: assert '3' == 'foo'
  
  - foo
  + 3
FAILED tests/test_read_user_choice.py::test_click_invocation[4-bar] - AssertionError: assert '4' == 'bar'
  
  - bar
  + 4
FAILED tests/test_read_user_choice.py::test_raise_if_options_is_not_a_non_empty_list - OSError: pytest: reading from stdin while output is captured!  Consider using `-s`.
FAILED tests/test_read_user_dict.py::test_process_json_invalid_json - Failed: DID NOT RAISE <class 'rich.prompt.InvalidResponse'>
FAILED tests/test_read_user_dict.py::test_process_json_non_dict - Failed: DID NOT RAISE <class 'rich.prompt.InvalidResponse'>
FAILED tests/test_read_user_dict.py::test_should_raise_type_error - Failed: DID NOT RAISE <class 'TypeError'>
FAILED tests/test_read_user_dict.py::test_should_call_prompt_with_process_json - AssertionError: assert ('name',) == ('name [cyan bold](default)[/]',)
  
  At index 0 diff: 'name' != 'name [cyan bold](default)[/]'
  
  Full diff:
    (
  -     'name [cyan bold](default)[/]',
  +     'name',
    )
FAILED tests/test_read_user_variable.py::test_input_loop_with_null_default_value - AssertionError: assert None == 'Kivy Project'
 +  where None = read_user_variable('project_name', None)
FAILED tests/test_specify_output_dir.py::test_api_invocation - AssertionError: expected call not found.
Expected: generate_files(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', accept_hooks=True, keep_project_on_failure=False)
Actual: generate_files(repo_dir=PosixPath('/tmp/tmp64dbz47s'), context=<MagicMock name='prompt_for_config()' id='136935391096368'>, output_dir='/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)

pytest introspection follows:

Kwargs:
assert {'repo_dir': PosixPath('/tmp/tmp64dbz47s'), 'context': <MagicMock name='prompt_for_config()' id='136935391096368'>, 'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False} == {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template', 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output', 'accept_hooks': True, 'keep_project_on_failure': False}
  
  Common items:
  {'accept_hooks': True,
   'keep_project_on_failure': False,
   'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output',
   'overwrite_if_exists': False,
   'skip_if_file_exists': False}
  Differing items:
  {'context': <MagicMock name='prompt_for_config()' id='136935391096368'>} != {'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}}
  {'repo_dir': PosixPath('/tmp/tmp64dbz47s')} != {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template'}
  
  Full diff:
    {
        'accept_hooks': True,
  +     'context': <MagicMock name='prompt_for_config()' id='136935391096368'>,
  -     'context': {
  -         'cookiecutter': {
  -             'email': 'raphael@hackebrot.de',
  -             'full_name': 'Raphael Pierzina',
  -             'github_username': 'hackebrot',
  -             'version': '0.1.0',
  -         },
  -     },
        'keep_project_on_failure': False,
        'output_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/output',
        'overwrite_if_exists': False,
  -     'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_api_invocation0/template',
  +     'repo_dir': PosixPath('/tmp/tmp64dbz47s'),
        'skip_if_file_exists': False,
    }
FAILED tests/test_specify_output_dir.py::test_default_output_dir - AssertionError: expected call not found.
Expected: generate_files(repo_dir='/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template', context={'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', accept_hooks=True, keep_project_on_failure=False)
Actual: generate_files(repo_dir=PosixPath('/tmp/tmpprfecdj1'), context=<MagicMock name='prompt_for_config()' id='136935390092624'>, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)

pytest introspection follows:

Kwargs:
assert {'repo_dir': PosixPath('/tmp/tmpprfecdj1'), 'context': <MagicMock name='prompt_for_config()' id='136935390092624'>, 'output_dir': '.', 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False} == {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template', 'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '.', 'accept_hooks': True, 'keep_project_on_failure': False}
  
  Common items:
  {'accept_hooks': True,
   'keep_project_on_failure': False,
   'output_dir': '.',
   'overwrite_if_exists': False,
   'skip_if_file_exists': False}
  Differing items:
  {'context': <MagicMock name='prompt_for_config()' id='136935390092624'>} != {'context': {'cookiecutter': {'email': 'raphael@hackebrot.de', 'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot', 'version': '0.1.0'}}}
  {'repo_dir': PosixPath('/tmp/tmpprfecdj1')} != {'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template'}
  
  Full diff:
    {
        'accept_hooks': True,
  +     'context': <MagicMock name='prompt_for_config()' id='136935390092624'>,
  -     'context': {
  -         'cookiecutter': {
  -             'email': 'raphael@hackebrot.de',
  -             'full_name': 'Raphael Pierzina',
  -             'github_username': 'hackebrot',
  -             'version': '0.1.0',
  -         },
  -     },
        'keep_project_on_failure': False,
        'output_dir': '.',
        'overwrite_if_exists': False,
  -     'repo_dir': '/tmp/pytest-of-openhands/pytest-30/test_default_output_dir0/template',
  +     'repo_dir': PosixPath('/tmp/tmpprfecdj1'),
        'skip_if_file_exists': False,
    }
FAILED tests/test_templates.py::test_build_templates[include] - TypeError: no loader for this environment specified
FAILED tests/test_templates.py::test_build_templates[extends] - TypeError: no loader for this environment specified
FAILED tests/test_templates.py::test_build_templates[super] - TypeError: no loader for this environment specified
FAILED tests/test_time_extension.py::test_utc_default_datetime_format - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_time_extension.py::test_accept_valid_timezones[utc] - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_time_extension.py::test_accept_valid_timezones[local] - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_time_extension.py::test_accept_valid_timezones[Europe/Berlin] - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_time_extension.py::test_environment_datetime_format - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_time_extension.py::test_add_time - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_time_extension.py::test_substract_time - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/test_time_extension.py::test_offset_with_format - jinja2.exceptions.TemplateSyntaxError: expected token 'end of statement block', got 'now'
FAILED tests/vcs/test_clone.py::test_clone_should_rstrip_trailing_slash_in_repo_url - cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'https://github.com/foo/bar/', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_rstrip_trail0/clone_dir']' returned non-zero exit status 128.
FAILED tests/vcs/test_clone.py::test_clone_should_abort_if_user_does_not_want_to_reclone - Failed: DID NOT RAISE <class 'SystemExit'>
FAILED tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[git-https://github.com/hello/world.git-world] - cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'https://github.com/hello/world.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c0/clone_dir/world']' returned non-zero exit status 128.
FAILED tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[hg-https://bitbucket.org/foo/bar-bar] - PermissionError: [Errno 13] Permission denied: 'hg'
FAILED tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[git-git@host:gitoliterepo-gitoliterepo] - cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'git@host:gitoliterepo', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c2/clone_dir/git@host:gitoliterepo']' returned non-zero exit status 128.
FAILED tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[git-git@gitlab.com:cookiecutter/cookiecutter.git-cookiecutter] - cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'git@gitlab.com:cookiecutter/cookiecutter.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c3/clone_dir/cookiecutter']' returned non-zero exit status 128.
FAILED tests/vcs/test_clone.py::test_clone_should_invoke_vcs_command[git-git@github.com:cookiecutter/cookiecutter.git-cookiecutter] - cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'git@github.com:cookiecutter/cookiecutter.git', '--branch', 'foobar', '/tmp/pytest-of-openhands/pytest-30/test_clone_should_invoke_vcs_c4/clone_dir/cookiecutter']' returned non-zero exit status 128.
FAILED tests/vcs/test_clone.py::test_clone_handles_repo_typo[fatal: repository 'https://github.com/hackebro/cookiedozer' not found] - cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'https://github.com/hackebro/cookiedozer', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_f0/clone_dir/cookiedozer']' returned non-zero exit status 128.
FAILED tests/vcs/test_clone.py::test_clone_handles_repo_typo[hg: abort: HTTP Error 404: Not Found] - cookiecutter.exceptions.RepositoryCloneFailed: Failed to clone repository: Command '['git', 'clone', 'https://github.com/hackebro/cookiedozer', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_repo_typo_h0/clone_dir/cookiedozer']' returned non-zero exit status 128.
FAILED tests/vcs/test_clone.py::test_clone_handles_branch_typo[error: pathspec 'unknown_branch' did not match any file(s) known to git] - assert "Failed to clone repository: Command '['git', 'clone', 'https://github.com/pytest-dev/cookiecutter-pytest-plugin', '--branch', 'unknown_branch', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo0/clone_dir/cookiecutter-pytest-plugin']' returned non-zero exit status 128." == 'The unknown_branch branch of repository https://github.com/pytest-dev/cookiecutter-pytest-plugin could not found, have you made a typo?'
  
  - The unknown_branch branch of repository https://github.com/pytest-dev/cookiecutter-pytest-plugin could not found, have you made a typo?
  + Failed to clone repository: Command '['git', 'clone', 'https://github.com/pytest-dev/cookiecutter-pytest-plugin', '--branch', 'unknown_branch', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo0/clone_dir/cookiecutter-pytest-plugin']' returned non-zero exit status 128.
FAILED tests/vcs/test_clone.py::test_clone_handles_branch_typo[hg: abort: unknown revision 'unknown_branch'!] - assert "Failed to clone repository: Command '['git', 'clone', 'https://github.com/pytest-dev/cookiecutter-pytest-plugin', '--branch', 'unknown_branch', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo1/clone_dir/cookiecutter-pytest-plugin']' returned non-zero exit status 128." == 'The unknown_branch branch of repository https://github.com/pytest-dev/cookiecutter-pytest-plugin could not found, have you made a typo?'
  
  - The unknown_branch branch of repository https://github.com/pytest-dev/cookiecutter-pytest-plugin could not found, have you made a typo?
  + Failed to clone repository: Command '['git', 'clone', 'https://github.com/pytest-dev/cookiecutter-pytest-plugin', '--branch', 'unknown_branch', '/tmp/pytest-of-openhands/pytest-30/test_clone_handles_branch_typo1/clone_dir/cookiecutter-pytest-plugin']' returned non-zero exit status 128.
FAILED tests/vcs/test_clone.py::test_clone_unknown_subprocess_error - Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>
FAILED tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[foo+git] - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>
FAILED tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[foo+hg] - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>
FAILED tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[foo+bar] - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>
FAILED tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[foobar] - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>
FAILED tests/vcs/test_identify_repo.py::test_identify_raise_on_unknown_repo[http://norepotypespecified.com] - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.UnknownRepoType'>
FAILED tests/vcs/test_is_vcs_installed.py::test_is_vcs_installed[-False] - AssertionError: assert True == False
 +  where True = <function is_vcs_installed at 0x7c8ac24131c0>('git')
 +    where <function is_vcs_installed at 0x7c8ac24131c0> = vcs.is_vcs_installed
FAILED tests/vcs/test_is_vcs_installed.py::test_is_vcs_installed[False-False] - AssertionError: assert True == False
 +  where True = <function is_vcs_installed at 0x7c8ac24131c0>('git')
 +    where <function is_vcs_installed at 0x7c8ac24131c0> = vcs.is_vcs_installed
FAILED tests/zipfile/test_unzip.py::test_unzip_protected_local_file_user_password_with_noinput - OSError: pytest: reading from stdin while output is captured!  Consider using `-s`.
FAILED tests/zipfile/test_unzip.py::test_empty_zip_file - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.InvalidZipRepository'>
FAILED tests/zipfile/test_unzip.py::test_non_repo_zip_file - Failed: DID NOT RAISE <class 'cookiecutter.exceptions.InvalidZipRepository'>
FAILED tests/zipfile/test_unzip.py::test_unzip_url - TypeError: a bytes-like object is required, not 'MagicMock'
FAILED tests/zipfile/test_unzip.py::test_unzip_url_with_empty_chunks - TypeError: a bytes-like object is required, not 'MagicMock'
FAILED tests/zipfile/test_unzip.py::test_unzip_url_existing_cache - TypeError: a bytes-like object is required, not 'MagicMock'
FAILED tests/zipfile/test_unzip.py::test_unzip_url_existing_cache_no_input - TypeError: a bytes-like object is required, not 'MagicMock'
FAILED tests/zipfile/test_unzip.py::test_unzip_should_abort_if_no_redownload - TypeError: a bytes-like object is required, not 'MagicMock'
FAILED tests/zipfile/test_unzip.py::test_unzip_is_ok_to_reuse - requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://example.com/path/to/fake-repo-tmpl.zip
============ 190 failed, 177 passed, 4 skipped, 1 warning in 9.65s =============