Skip to content

back to OpenHands summary

OpenHands: cookiecutter

Pytest Summary for test tests

status count
passed 116
failed 237
error 14
skipped 4
total 371
collected 371

Failed pytests:

test_dump.py::test_value_error_if_key_missing_in_context

test_dump.py::test_value_error_if_key_missing_in_context
replay_test_dir = 'tests/test-replay/', template_name = 'cookiedozer'

    def test_value_error_if_key_missing_in_context(replay_test_dir, template_name):
        """Test that replay.dump raises if the context does not contain a key \
        named 'cookiecutter'."""
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

tests/replay/test_dump.py:50: Failed

test_load.py::test_value_error_if_key_missing_in_context

test_load.py::test_value_error_if_key_missing_in_context
mocker = 
replay_test_dir = 'tests/test-replay/'

    def test_value_error_if_key_missing_in_context(mocker, replay_test_dir):
        """Test that replay.load raises if the loaded context does not contain \
        'cookiecutter'."""
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

tests/replay/test_load.py:33: Failed

test_replay.py::test_raise_on_invalid_mode[invalid_kwargs1]

test_replay.py::test_raise_on_invalid_mode[invalid_kwargs1]
invalid_kwargs = {'extra_context': {}}

    @pytest.mark.parametrize(
        'invalid_kwargs',
        (
            {'no_input': True},
            {'extra_context': {}},
            {'no_input': True, 'extra_context': {}},
        ),
    )
    def test_raise_on_invalid_mode(invalid_kwargs):
        """Test `cookiecutter` raise exception on unacceptable `replay` request."""
        with pytest.raises(exceptions.InvalidModeException):
>           main.cookiecutter('foo', replay=True, **invalid_kwargs)

tests/replay/test_replay.py:29: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'foo', checkout = None, no_input = False, extra_context = {}
replay = True, overwrite_if_exists = False, output_dir = '.', config_file = None
default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_replay.py::test_main_does_not_invoke_dump_but_load

test_replay.py::test_main_does_not_invoke_dump_but_load
mocker = 

    def test_main_does_not_invoke_dump_but_load(mocker):
        """Test `cookiecutter` calling correct functions on `replay`."""
        mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
        mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
        mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
        mock_replay_dump = mocker.patch('cookiecutter.main.dump')
        mock_replay_load = mocker.patch('cookiecutter.main.load')

>       main.cookiecutter('tests/fake-repo-tmpl/', replay=True)

tests/replay/test_replay.py:40: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-tmpl/', checkout = None, no_input = False
extra_context = None, replay = True, overwrite_if_exists = False
output_dir = '.', config_file = None, default_config = False, password = None
directory = None, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_replay.py::test_main_does_not_invoke_load_but_dump

test_replay.py::test_main_does_not_invoke_load_but_dump
mocker = 

    def test_main_does_not_invoke_load_but_dump(mocker):
        """Test `cookiecutter` calling correct functions on non-replay launch."""
        mock_prompt = mocker.patch('cookiecutter.main.prompt_for_config')
        mock_gen_context = mocker.patch('cookiecutter.main.generate_context')
        mock_gen_files = mocker.patch('cookiecutter.main.generate_files')
        mock_replay_dump = mocker.patch('cookiecutter.main.dump')
        mock_replay_load = mocker.patch('cookiecutter.main.load')

>       main.cookiecutter('tests/fake-repo-tmpl/', replay=False)

tests/replay/test_replay.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-tmpl/', checkout = None, no_input = False
extra_context = None, replay = False, overwrite_if_exists = False
output_dir = '.', config_file = None, default_config = False, password = None
directory = None, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_abbreviation_expansion.py::test_abbreviation_expansion[Simple expansion]

test_abbreviation_expansion.py::test_abbreviation_expansion[Simple expansion]
template = 'foo', abbreviations = {'foo': 'bar'}, expected_result = 'bar'

    @pytest.mark.parametrize(
        ('template', 'abbreviations', 'expected_result'),
        [
            ('foo', {'foo': 'bar'}, 'bar'),
            ('baz', {'foo': 'bar'}, 'baz'),
            ('xx:a', {'xx': '<{0}>'}, ''),
            ('gh:a', {'gh': '<{0}>'}, ''),
            ('xx:a', {'xx': '<>'}, '<>'),
            (
                'gh:pydanny/cookiecutter-django',
                BUILTIN_ABBREVIATIONS,
                'https://github.com/pydanny/cookiecutter-django.git',
            ),
            (
                'gl:pydanny/cookiecutter-django',
                BUILTIN_ABBREVIATIONS,
                'https://gitlab.com/pydanny/cookiecutter-django.git',
            ),
            (
                'bb:pydanny/cookiecutter-django',
                BUILTIN_ABBREVIATIONS,
                'https://bitbucket.org/pydanny/cookiecutter-django',
            ),
        ],
        ids=(
            'Simple expansion',
            'Skip expansion (expansion not an abbreviation)',
            'Expansion prefix',
            'expansion_override_builtin',
            'expansion_prefix_ignores_suffix',
            'Correct expansion for builtin abbreviations (github)',
            'Correct expansion for builtin abbreviations (gitlab)',
            'Correct expansion for builtin abbreviations (bitbucket)',
        ),
    )
    def test_abbreviation_expansion(template, abbreviations, expected_result):
        """Verify abbreviation unpacking."""
        expanded = expand_abbreviations(template, abbreviations)
>       assert expanded == expected_result
E       AssertionError: assert 'foo' == 'bar'
E         
E         - bar
E         + foo

tests/repository/test_abbreviation_expansion.py:47: AssertionError

test_determine_repo_dir_clones_repo.py::test_repository_url_should_clone

test_determine_repo_dir_clones_repo.py::test_repository_url_should_clone
mocker = 
template_url = 'https://github.com/pytest-dev/cookiecutter-pytest-plugin.git'
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutter_replay'}

    def test_repository_url_should_clone(mocker, template_url, user_config_data):
        """Verify repository url triggers clone function.

        `clone()` should be called with correct args when `determine_repo_dir()` is
        passed a repository template url.
        """
        mock_clone = mocker.patch(
            'cookiecutter.repository.clone',
            return_value='tests/fake-repo-tmpl',
            autospec=True,
        )

        project_dir, cleanup = repository.determine_repo_dir(
            template_url,
            abbreviations={},
            clone_to_dir=user_config_data['cookiecutters_dir'],
            checkout=None,
            no_input=True,
        )

        mock_clone.assert_called_once_with(
            repo_url=template_url,
            checkout=None,
            clone_to_dir=user_config_data['cookiecutters_dir'],
            no_input=True,
        )

        assert os.path.isdir(project_dir)
>       assert not cleanup
E       assert not True

tests/repository/test_determine_repo_dir_clones_repo.py:89: AssertionError

test_determine_repo_dir_finds_existing_cookiecutter.py::test_should_find_existing_cookiecutter

test_determine_repo_dir_finds_existing_cookiecutter.py::test_should_find_existing_cookiecutter
template = 'cookiecutter-pytest-plugin'
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutter_replay'}
cloned_cookiecutter_path = '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutters/cookiecutter-pytest-plugin'

    def test_should_find_existing_cookiecutter(
        template, user_config_data, cloned_cookiecutter_path
    ):
        """
        Should find folder created by `cloned_cookiecutter_path` and return it.

        This folder is considered like previously cloned project directory.
        """
>       project_dir, cleanup = repository.determine_repo_dir(
            template=template,
            abbreviations={},
            clone_to_dir=user_config_data['cookiecutters_dir'],
            checkout=None,
            no_input=True,
        )

tests/repository/test_determine_repo_dir_finds_existing_cookiecutter.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/repository.py:103: in determine_repo_dir
    repo_dir = clone(
cookiecutter/vcs.py:72: in clone
    repo_type, repo_url = identify_repo(repo_url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'cookiecutter-pytest-plugin'

    def identify_repo(repo_url):
        """Determine if `repo_url` should be treated as a URL to a git or hg repo.

        Repos can be identified by prepending "hg+" or "git+" to the repo URL.

        :param repo_url: Repo URL of unknown type.
        :returns: ('git', repo_url), ('hg', repo_url), or None.
        :raises: UnknownRepoType if the repo type cannot be determined.
        """
        if repo_url.startswith('git+'):
            return 'git', repo_url[4:]
        elif repo_url.startswith('hg+'):
            return 'hg', repo_url[3:]
        elif any(host in repo_url for host in ['github.com', 'gitlab.com', 'gitorious.org']):
            return 'git', repo_url
        elif 'bitbucket.org' in repo_url:
            if repo_url.endswith('.git'):
                return 'git', repo_url
            else:
                return 'hg', repo_url
        elif repo_url.endswith('.git'):
            return 'git', repo_url
        elif repo_url.endswith('.hg'):
            return 'hg', repo_url
        elif '@' in repo_url and ':' in repo_url:
            # SSH URL format: [user@]host:path
            return 'git', repo_url
>       raise UnknownRepoType
E       cookiecutter.exceptions.UnknownRepoType

cookiecutter/vcs.py:41: UnknownRepoType

test_determine_repo_dir_finds_subdirectories.py::test_should_find_existing_cookiecutter

test_determine_repo_dir_finds_subdirectories.py::test_should_find_existing_cookiecutter
template = 'cookiecutter-pytest-plugin'
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutter_replay'}
cloned_cookiecutter_path = '/tmp/pytest-of-root/pytest-0/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',
        )

tests/repository/test_determine_repo_dir_finds_subdirectories.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/repository.py:103: in determine_repo_dir
    repo_dir = clone(
cookiecutter/vcs.py:72: in clone
    repo_type, repo_url = identify_repo(repo_url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'cookiecutter-pytest-plugin'

    def identify_repo(repo_url):
        """Determine if `repo_url` should be treated as a URL to a git or hg repo.

        Repos can be identified by prepending "hg+" or "git+" to the repo URL.

        :param repo_url: Repo URL of unknown type.
        :returns: ('git', repo_url), ('hg', repo_url), or None.
        :raises: UnknownRepoType if the repo type cannot be determined.
        """
        if repo_url.startswith('git+'):
            return 'git', repo_url[4:]
        elif repo_url.startswith('hg+'):
            return 'hg', repo_url[3:]
        elif any(host in repo_url for host in ['github.com', 'gitlab.com', 'gitorious.org']):
            return 'git', repo_url
        elif 'bitbucket.org' in repo_url:
            if repo_url.endswith('.git'):
                return 'git', repo_url
            else:
                return 'hg', repo_url
        elif repo_url.endswith('.git'):
            return 'git', repo_url
        elif repo_url.endswith('.hg'):
            return 'hg', repo_url
        elif '@' in repo_url and ':' in repo_url:
            # SSH URL format: [user@]host:path
            return 'git', repo_url
>       raise UnknownRepoType
E       cookiecutter.exceptions.UnknownRepoType

cookiecutter/vcs.py:41: UnknownRepoType

test_determine_repo_dir_finds_subdirectories.py::test_local_repo_typo

test_determine_repo_dir_finds_subdirectories.py::test_local_repo_typo
template = 'cookiecutter-pytest-plugin'
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutter_replay'}
cloned_cookiecutter_path = '/tmp/pytest-of-root/pytest-0/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:
>           repository.determine_repo_dir(
                template=template,
                abbreviations={},
                clone_to_dir=user_config_data['cookiecutters_dir'],
                checkout=None,
                no_input=True,
                directory='wrong-dir',
            )

tests/repository/test_determine_repo_dir_finds_subdirectories.py:54: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/repository.py:103: in determine_repo_dir
    repo_dir = clone(
cookiecutter/vcs.py:72: in clone
    repo_type, repo_url = identify_repo(repo_url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'cookiecutter-pytest-plugin'

    def identify_repo(repo_url):
        """Determine if `repo_url` should be treated as a URL to a git or hg repo.

        Repos can be identified by prepending "hg+" or "git+" to the repo URL.

        :param repo_url: Repo URL of unknown type.
        :returns: ('git', repo_url), ('hg', repo_url), or None.
        :raises: UnknownRepoType if the repo type cannot be determined.
        """
        if repo_url.startswith('git+'):
            return 'git', repo_url[4:]
        elif repo_url.startswith('hg+'):
            return 'hg', repo_url[3:]
        elif any(host in repo_url for host in ['github.com', 'gitlab.com', 'gitorious.org']):
            return 'git', repo_url
        elif 'bitbucket.org' in repo_url:
            if repo_url.endswith('.git'):
                return 'git', repo_url
            else:
                return 'hg', repo_url
        elif repo_url.endswith('.git'):
            return 'git', repo_url
        elif repo_url.endswith('.hg'):
            return 'hg', repo_url
        elif '@' in repo_url and ':' in repo_url:
            # SSH URL format: [user@]host:path
            return 'git', repo_url
>       raise UnknownRepoType
E       cookiecutter.exceptions.UnknownRepoType

cookiecutter/vcs.py:41: UnknownRepoType

test_determine_repository_should_use_local_repo.py::test_local_repo_with_no_context_raises

test_determine_repository_should_use_local_repo.py::test_local_repo_with_no_context_raises
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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,
            )

tests/repository/test_determine_repository_should_use_local_repo.py:29: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/repository.py:103: in determine_repo_dir
    repo_dir = clone(
cookiecutter/vcs.py:72: in clone
    repo_type, repo_url = identify_repo(repo_url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'tests/fake-repo-bad'

    def identify_repo(repo_url):
        """Determine if `repo_url` should be treated as a URL to a git or hg repo.

        Repos can be identified by prepending "hg+" or "git+" to the repo URL.

        :param repo_url: Repo URL of unknown type.
        :returns: ('git', repo_url), ('hg', repo_url), or None.
        :raises: UnknownRepoType if the repo type cannot be determined.
        """
        if repo_url.startswith('git+'):
            return 'git', repo_url[4:]
        elif repo_url.startswith('hg+'):
            return 'hg', repo_url[3:]
        elif any(host in repo_url for host in ['github.com', 'gitlab.com', 'gitorious.org']):
            return 'git', repo_url
        elif 'bitbucket.org' in repo_url:
            if repo_url.endswith('.git'):
                return 'git', repo_url
            else:
                return 'hg', repo_url
        elif repo_url.endswith('.git'):
            return 'git', repo_url
        elif repo_url.endswith('.hg'):
            return 'hg', repo_url
        elif '@' in repo_url and ':' in repo_url:
            # SSH URL format: [user@]host:path
            return 'git', repo_url
>       raise UnknownRepoType
E       cookiecutter.exceptions.UnknownRepoType

cookiecutter/vcs.py:41: UnknownRepoType

test_determine_repository_should_use_local_repo.py::test_local_repo_typo

test_determine_repository_should_use_local_repo.py::test_local_repo_typo
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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,
            )

tests/repository/test_determine_repository_should_use_local_repo.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/repository.py:103: in determine_repo_dir
    repo_dir = clone(
cookiecutter/vcs.py:72: in clone
    repo_type, repo_url = identify_repo(repo_url)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_url = 'tests/unknown-repo'

    def identify_repo(repo_url):
        """Determine if `repo_url` should be treated as a URL to a git or hg repo.

        Repos can be identified by prepending "hg+" or "git+" to the repo URL.

        :param repo_url: Repo URL of unknown type.
        :returns: ('git', repo_url), ('hg', repo_url), or None.
        :raises: UnknownRepoType if the repo type cannot be determined.
        """
        if repo_url.startswith('git+'):
            return 'git', repo_url[4:]
        elif repo_url.startswith('hg+'):
            return 'hg', repo_url[3:]
        elif any(host in repo_url for host in ['github.com', 'gitlab.com', 'gitorious.org']):
            return 'git', repo_url
        elif 'bitbucket.org' in repo_url:
            if repo_url.endswith('.git'):
                return 'git', repo_url
            else:
                return 'hg', repo_url
        elif repo_url.endswith('.git'):
            return 'git', repo_url
        elif repo_url.endswith('.hg'):
            return 'hg', repo_url
        elif '@' in repo_url and ':' in repo_url:
            # SSH URL format: [user@]host:path
            return 'git', repo_url
>       raise UnknownRepoType
E       cookiecutter.exceptions.UnknownRepoType

cookiecutter/vcs.py:41: UnknownRepoType

test_abort_generate_on_hook_error.py::test_hooks_raises_errors[pre_gen_hook_raises_error]

test_abort_generate_on_hook_error.py::test_hooks_raises_errors[pre_gen_hook_raises_error]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_hooks_raises_errors_pre_g0')
abort_pre_gen = 'yes', abort_post_gen = 'no'

    @pytest.mark.parametrize(
        ("abort_pre_gen", "abort_post_gen"),
        (("yes", "no"), ("no", "yes")),
        ids=("pre_gen_hook_raises_error", "post_gen_hook_raises_error"),
    )
    @pytest.mark.usefixtures("clean_system")
    def test_hooks_raises_errors(tmp_path, abort_pre_gen, abort_post_gen):
        """Verify pre- and pos-gen errors raises correct error code from script.

        This allows developers to make different error codes in their code,
        for different errors.
        """
        context = {
            "cookiecutter": {
                "repo_dir": "foobar",
                "abort_pre_gen": abort_pre_gen,
                "abort_post_gen": abort_post_gen,
            }
        }

        with pytest.raises(exceptions.FailedHookException) as error:
>           generate.generate_files(
                repo_dir="tests/hooks-abort-render",
                context=context,
                output_dir=str(tmp_path),
            )

tests/test_abort_generate_on_hook_error.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/hooks-abort-render'
context = {'cookiecutter': {'abort_post_gen': 'no', 'abort_pre_gen': 'yes', 'repo_dir': 'foobar'}}
output_dir = '/tmp/pytest-of-root/pytest-0/test_hooks_raises_errors_pre_g0'
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_abort_generate_on_hook_error.py::test_hooks_raises_errors[post_gen_hook_raises_error]

test_abort_generate_on_hook_error.py::test_hooks_raises_errors[post_gen_hook_raises_error]
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_hooks_raises_errors_post_0')
abort_pre_gen = 'no', abort_post_gen = 'yes'

    @pytest.mark.parametrize(
        ("abort_pre_gen", "abort_post_gen"),
        (("yes", "no"), ("no", "yes")),
        ids=("pre_gen_hook_raises_error", "post_gen_hook_raises_error"),
    )
    @pytest.mark.usefixtures("clean_system")
    def test_hooks_raises_errors(tmp_path, abort_pre_gen, abort_post_gen):
        """Verify pre- and pos-gen errors raises correct error code from script.

        This allows developers to make different error codes in their code,
        for different errors.
        """
        context = {
            "cookiecutter": {
                "repo_dir": "foobar",
                "abort_pre_gen": abort_pre_gen,
                "abort_post_gen": abort_post_gen,
            }
        }

        with pytest.raises(exceptions.FailedHookException) as error:
>           generate.generate_files(
                repo_dir="tests/hooks-abort-render",
                context=context,
                output_dir=str(tmp_path),
            )

tests/test_abort_generate_on_hook_error.py:34: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/hooks-abort-render'
context = {'cookiecutter': {'abort_post_gen': 'yes', 'abort_pre_gen': 'no', 'repo_dir': 'foobar'}}
output_dir = '/tmp/pytest-of-root/pytest-0/test_hooks_raises_errors_post_0'
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_cli.py::test_cli_error_on_existing_output_directory

test_cli.py::test_cli_error_on_existing_output_directory
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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
        expected_error_msg = 'Error: "fake-project" directory already exists\n'
>       assert result.output == expected_error_msg
E       assert '' == 'Error: "fake-project" directory already exists\n'
E         
E         - Error: "fake-project" directory already exists

tests/test_cli.py:81: AssertionError

test_cli.py::test_cli

test_cli.py::test_cli
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:88: AssertionError

test_cli.py::test_cli_verbose

test_cli.py::test_cli_verbose
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:98: AssertionError

test_cli.py::test_cli_replay

test_cli.py::test_cli_replay
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', 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)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6fb27e20>
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: cookiecutter('tests/fake-repo-pre/', 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           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': True, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': True,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': True,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': True, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': True,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': True,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:113: AssertionError

test_cli.py::test_cli_replay_file

test_cli.py::test_cli_replay_file
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', 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)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file='~/custom-replay-file')
_error_message = ._error_message at 0x7f6a6f9be560>
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: cookiecutter('tests/fake-repo-pre/', 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           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file='~/custom-replay-file')

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file='~/custom-replay-file')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': '~/custom-replay-file'} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'replay': False} != {'replay': '~/custom-replay-file'}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': '~/custom-replay-file'}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E         +     'replay': False,
E         -     'replay': '~/custom-replay-file',
E         +     'replay_file': '~/custom-replay-file',
E         ?            +++++
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file='~/custom-replay-file')
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': '~/custom-replay-file'} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'replay': False} != {'replay': '~/custom-replay-file'}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': '~/custom-replay-file'}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E         +     'replay': False,
E         -     'replay': '~/custom-replay-file',
E         +     'replay_file': '~/custom-replay-file',
E         ?            +++++
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:140: AssertionError

test_cli.py::test_cli_replay_generated

test_cli.py::test_cli_replay_generated
mocker = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:170: AssertionError

test_cli.py::test_cli_exit_on_noinput_and_replay

test_cli.py::test_cli_exit_on_noinput_and_replay
mocker = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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

        expected_error_msg = (
            "You can not use both replay and no_input or extra_context at the same time."
        )

>       assert expected_error_msg in result.output
E       AssertionError: assert 'You can not use both replay and no_input or extra_context at the same time.' in 'Error: --no-input and --replay cannot be used together.\n'
E        +  where 'Error: --no-input and --replay cannot be used together.\n' = .output

tests/test_cli.py:190: AssertionError

test_cli.py::test_run_cookiecutter_on_overwrite_if_exists_and_replay[-f]

test_cli.py::test_run_cookiecutter_on_overwrite_if_exists_and_replay[-f]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', 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)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=True, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6fb27f40>
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: cookiecutter('tests/fake-repo-pre/', 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           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=True, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=True, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': True, 'overwrite_if_exists': True, 'output_dir': '.', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': True,
E          'password': None,
E          'replay': True,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': True,
E               'password': None,
E               'replay': True,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=True, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': True, 'overwrite_if_exists': True, 'output_dir': '.', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': True,
E          'password': None,
E          'replay': True,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': True,
E               'password': None,
E               'replay': True,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:228: AssertionError

test_cli.py::test_run_cookiecutter_on_overwrite_if_exists_and_replay[--overwrite-if-exists]

test_cli.py::test_run_cookiecutter_on_overwrite_if_exists_and_replay[--overwrite-if-exists]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', 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)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=True, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f9bfa30>
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: cookiecutter('tests/fake-repo-pre/', 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           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=True, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=True, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': True, 'overwrite_if_exists': True, 'output_dir': '.', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': True,
E          'password': None,
E          'replay': True,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': True,
E               'password': None,
E               'replay': True,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=True, overwrite_if_exists=True, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': True, 'overwrite_if_exists': True, 'output_dir': '.', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': True,
E          'password': None,
E          'replay': True,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': True,
E               'password': None,
E               'replay': True,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:228: AssertionError

test_cli.py::test_cli_overwrite_if_exists_when_output_dir_does_not_exist[-f]

test_cli.py::test_cli_overwrite_if_exists_when_output_dir_does_not_exist[-f]
cli_runner = .cli_main at 0x7f6a6fb25cf0>
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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:256: AssertionError

test_cli.py::test_cli_overwrite_if_exists_when_output_dir_does_not_exist[--overwrite-if-exists]

test_cli.py::test_cli_overwrite_if_exists_when_output_dir_does_not_exist[--overwrite-if-exists]
cli_runner = .cli_main at 0x7f6a6fb25cf0>
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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:256: AssertionError

test_cli.py::test_cli_overwrite_if_exists_when_output_dir_exists[-f]

test_cli.py::test_cli_overwrite_if_exists_when_output_dir_exists[-f]
request = >

    @pytest.fixture
    def make_fake_project_dir(request):
        """Create a fake project to be overwritten in the according tests."""
>       os.makedirs('fake-project')

tests/test_cli.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'fake-project', mode = 511, exist_ok = False

    def makedirs(name, mode=0o777, exist_ok=False):
        """makedirs(name [, mode=0o777][, exist_ok=False])

        Super-mkdir; create a leaf directory and all intermediate ones.  Works like
        mkdir, except that any intermediate path segment (not just the rightmost)
        will be created if it does not exist. If the target directory already
        exists, raise an OSError if exist_ok is False. Otherwise no exception is
        raised.  This is recursive.

        """
        head, tail = path.split(name)
        if not tail:
            head, tail = path.split(head)
        if head and tail and not path.exists(head):
            try:
                makedirs(head, exist_ok=exist_ok)
            except FileExistsError:
                # Defeats race condition when another thread created the path
                pass
            cdir = curdir
            if isinstance(tail, bytes):
                cdir = bytes(curdir, 'ASCII')
            if tail == cdir:           # xxx/newdir/. exists if xxx/newdir exists
                return
        try:
>           mkdir(name, mode)
E           FileExistsError: [Errno 17] File exists: 'fake-project'

/usr/lib/python3.10/os.py:225: FileExistsError

test_cli.py::test_cli_overwrite_if_exists_when_output_dir_exists[--overwrite-if-exists]

test_cli.py::test_cli_overwrite_if_exists_when_output_dir_exists[--overwrite-if-exists]
request = >

    @pytest.fixture
    def make_fake_project_dir(request):
        """Create a fake project to be overwritten in the according tests."""
>       os.makedirs('fake-project')

tests/test_cli.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'fake-project', mode = 511, exist_ok = False

    def makedirs(name, mode=0o777, exist_ok=False):
        """makedirs(name [, mode=0o777][, exist_ok=False])

        Super-mkdir; create a leaf directory and all intermediate ones.  Works like
        mkdir, except that any intermediate path segment (not just the rightmost)
        will be created if it does not exist. If the target directory already
        exists, raise an OSError if exist_ok is False. Otherwise no exception is
        raised.  This is recursive.

        """
        head, tail = path.split(name)
        if not tail:
            head, tail = path.split(head)
        if head and tail and not path.exists(head):
            try:
                makedirs(head, exist_ok=exist_ok)
            except FileExistsError:
                # Defeats race condition when another thread created the path
                pass
            cdir = curdir
            if isinstance(tail, bytes):
                cdir = bytes(curdir, 'ASCII')
            if tail == cdir:           # xxx/newdir/. exists if xxx/newdir exists
                return
        try:
>           mkdir(name, mode)
E           FileExistsError: [Errno 17] File exists: 'fake-project'

/usr/lib/python3.10/os.py:225: FileExistsError

test_cli.py::test_cli_output_dir[-o]

test_cli.py::test_cli_output_dir[-o]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f9be9e0>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir__o_0/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:285: AssertionError

test_cli.py::test_cli_output_dir[--output-dir]

test_cli.py::test_cli_output_dir[--output-dir]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6fb26a70>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_output_dir___output_d0/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:285: AssertionError

test_cli.py::test_cli_help[help]

test_cli.py::test_cli_help[help]
cli_runner = .cli_main at 0x7f6a6fb25cf0>
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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:312: AssertionError

test_cli.py::test_user_config

test_cli.py::test_user_config
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6fa488b0>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '.', 'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml',
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml',
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
user_config_path = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', default_config=False, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '.', 'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml', 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml',
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': '/tmp/pytest-of-root/pytest-0/test_user_config0/tests/config.yaml',
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:330: AssertionError

test_cli.py::test_default_user_config_overwrite

test_cli.py::test_default_user_config_overwrite
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', 'default_config': True, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', default_config=True, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', default_config=True, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6fa48430>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', default_config=True, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', default_config=True, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', 'default_config': True, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', default_config=True, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', default_config=True, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', 'default_config': True, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '.', 'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', 'default_config': True, 'extra_context': None, 'password': None, 'directory': None, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml',
E          'default_config': True,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml',
E               'default_config': True,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
user_config_path = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, skip_if_file_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', default_config=True, extra_context=None, password=None, directory=None, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file='/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', default_config=True, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', 'default_config': True, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'skip_if_file_exists': False, 'output_dir': '.', 'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml', 'default_config': True, 'extra_context': None, 'password': None, 'directory': None, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml',
E          'default_config': True,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': '/tmp/pytest-of-root/pytest-0/test_default_user_config_overw0/tests/config.yaml',
E               'default_config': True,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:361: AssertionError

test_cli.py::test_default_user_config

test_cli.py::test_default_user_config
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': True, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', 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)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=True, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6fb27e20>
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: cookiecutter('tests/fake-repo-pre/', 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           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=True, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': True, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=True, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': None, 'default_config': True, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': True,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': True,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', 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       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=True, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '.', 'config_file': None, 'default_config': True, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'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         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': True,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '.',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': True,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '.',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:387: AssertionError

test_cli.py::test_echo_undefined_variable_error

test_cli.py::test_echo_undefined_variable_error
output_dir = '/tmp/pytest-of-root/pytest-0/test_echo_undefined_variable_e0/output'
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    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

        error = "Unable to create file '{{cookiecutter.foobar}}'"
>       assert error in result.output
E       assert "Unable to create file '{{cookiecutter.foobar}}'" in ''
E        +  where '' = .output

tests/test_cli.py:420: AssertionError

test_cli.py::test_echo_unknown_extension_error

test_cli.py::test_echo_unknown_extension_error
output_dir = '/tmp/pytest-of-root/pytest-0/test_echo_unknown_extension_er0/output'
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    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

>       assert 'Unable to load extension: ' in result.output
E       assert 'Unable to load extension: ' in ''
E        +  where '' = .output

tests/test_cli.py:459: AssertionError

test_cli.py::test_local_extension

test_cli.py::test_local_extension
tmpdir = local('/tmp/pytest-of-root/pytest-0/test_local_extension0')
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:474: AssertionError

test_cli.py::test_cli_extra_context

test_cli.py::test_cli_extra_context
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:499: AssertionError

test_cli.py::test_debug_file_non_verbose

test_cli.py::test_debug_file_non_verbose
cli_runner = .cli_main at 0x7f6a6fb25cf0>
debug_file = PosixPath('/tmp/pytest-of-root/pytest-0/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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:539: AssertionError

test_cli.py::test_debug_file_verbose

test_cli.py::test_debug_file_verbose
cli_runner = .cli_main at 0x7f6a6fb25cf0>
debug_file = PosixPath('/tmp/pytest-of-root/pytest-0/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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:566: AssertionError

test_cli.py::test_debug_list_installed_templates

test_cli.py::test_debug_list_installed_templates
request = >

    @pytest.fixture
    def make_fake_project_dir(request):
        """Create a fake project to be overwritten in the according tests."""
>       os.makedirs('fake-project')

tests/test_cli.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'fake-project', mode = 511, exist_ok = False

    def makedirs(name, mode=0o777, exist_ok=False):
        """makedirs(name [, mode=0o777][, exist_ok=False])

        Super-mkdir; create a leaf directory and all intermediate ones.  Works like
        mkdir, except that any intermediate path segment (not just the rightmost)
        will be created if it does not exist. If the target directory already
        exists, raise an OSError if exist_ok is False. Otherwise no exception is
        raised.  This is recursive.

        """
        head, tail = path.split(name)
        if not tail:
            head, tail = path.split(head)
        if head and tail and not path.exists(head):
            try:
                makedirs(head, exist_ok=exist_ok)
            except FileExistsError:
                # Defeats race condition when another thread created the path
                pass
            cdir = curdir
            if isinstance(tail, bytes):
                cdir = bytes(curdir, 'ASCII')
            if tail == cdir:           # xxx/newdir/. exists if xxx/newdir exists
                return
        try:
>           mkdir(name, mode)
E           FileExistsError: [Errno 17] File exists: 'fake-project'

/usr/lib/python3.10/os.py:225: FileExistsError

test_cli.py::test_debug_list_installed_templates_failure

test_cli.py::test_debug_list_installed_templates_failure
cli_runner = .cli_main at 0x7f6a6fb25cf0>
debug_file = PosixPath('/tmp/pytest-of-root/pytest-0/test_debug_list_installed_temp1/fake-repo.log')
user_config_path = '/tmp/pytest-of-root/pytest-0/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       assert 'Error: Cannot list installed templates.' in ''
E        +  where '' = .output

tests/test_cli.py:609: AssertionError

test_cli.py::test_directory_repo

test_cli.py::test_directory_repo
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:622: AssertionError

test_cli.py::test_cli_accept_hooks[-o---accept-hooks=yes-None-True]

test_cli.py::test_cli_accept_hooks[-o---accept-hooks=yes-None-True]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f389120>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc0/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:657: AssertionError

test_cli.py::test_cli_accept_hooks[-o---accept-hooks=no-None-False]

test_cli.py::test_cli_accept_hooks[-o---accept-hooks=no-None-False]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f844b80>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': False,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': False,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': False,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': False,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc1/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:657: AssertionError

test_cli.py::test_cli_accept_hooks[-o---accept-hooks=ask-yes-True]

test_cli.py::test_cli_accept_hooks[-o---accept-hooks=ask-yes-True]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f844dc0>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'accept_hooks': False} != {'accept_hooks': True}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E         -     'accept_hooks': True,
E         ?                     ^^^
E         +     'accept_hooks': False,
E         ?                     ^^^^
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'accept_hooks': False} != {'accept_hooks': True}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E         -     'accept_hooks': True,
E         ?                     ^^^
E         +     'accept_hooks': False,
E         ?                     ^^^^
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc2/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:657: AssertionError

test_cli.py::test_cli_accept_hooks[-o---accept-hooks=ask-no-False]

test_cli.py::test_cli_accept_hooks[-o---accept-hooks=ask-no-False]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f845240>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': False,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': False,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '-o'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': False,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': False,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks__o___acc3/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:657: AssertionError

test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=yes-None-True]

test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=yes-None-True]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f845120>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': True,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': True,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output0/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:657: AssertionError

test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=no-None-False]

test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=no-None-False]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f845750>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': False,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': False,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': False,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': False,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output1/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:657: AssertionError

test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=ask-yes-True]

test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=ask-yes-True]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f846d40>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': True, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'accept_hooks': False} != {'accept_hooks': True}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E         -     'accept_hooks': True,
E         ?                     ^^^
E         +     'accept_hooks': False,
E         ?                     ^^^^
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': True, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Differing items:
E         {'accept_hooks': False} != {'accept_hooks': True}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E         -     'accept_hooks': True,
E         ?                     ^^^
E         +     'accept_hooks': False,
E         ?                     ^^^^
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output2/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:657: AssertionError

test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=ask-no-False]

test_cli.py::test_cli_accept_hooks[--output-dir---accept-hooks=ask-no-False]
self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}
expected = call('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
actual = call('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
_error_message = ._error_message at 0x7f6a6f845e10>
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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E           Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)

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

During handling of the above exception, another exception occurred:

self = 
args = ('tests/fake-repo-pre/', None, False)
kwargs = {'accept_hooks': False, 'config_file': None, 'default_config': False, 'directory': None, ...}

    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: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': False,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': False,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
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 = 
cli_runner = .cli_main at 0x7f6a6fb25cf0>
output_dir_flag = '--output-dir'
output_dir = '/tmp/pytest-of-root/pytest-0/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 call not found.
E       Expected: cookiecutter('tests/fake-repo-pre/', None, False, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', config_file=None, default_config=False, extra_context=None, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False)
E       Actual: cookiecutter('tests/fake-repo-pre/', checkout=None, no_input=False, extra_context=None, replay=False, overwrite_if_exists=False, output_dir='/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=False, keep_project_on_failure=False, replay_file=None)
E       
E       pytest introspection follows:
E       
E       Args:
E       assert ('tests/fake-repo-pre/',) == ('tests/fake-repo-pre/', None, False)
E         
E         Right contains 2 more items, first extra item: None
E         
E         Full diff:
E           (
E               'tests/fake-repo-pre/',
E         -     None,
E         -     False,
E           )
E       Kwargs:
E       assert {'checkout': None, 'no_input': False, 'extra_context': None, 'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', 'config_file': None, 'default_config': False, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False, 'replay_file': None} == {'replay': False, 'overwrite_if_exists': False, 'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output', 'config_file': None, 'default_config': False, 'extra_context': None, 'password': None, 'directory': None, 'skip_if_file_exists': False, 'accept_hooks': False, 'keep_project_on_failure': False}
E         
E         Common items:
E         {'accept_hooks': False,
E          'config_file': None,
E          'default_config': False,
E          'directory': None,
E          'extra_context': None,
E          'keep_project_on_failure': False,
E          'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output',
E          'overwrite_if_exists': False,
E          'password': None,
E          'replay': False,
E          'skip_if_file_exists': False}
E         Left contains 3 more items:
E         {'checkout': None, 'no_input': False, 'replay_file': None}
E         
E         Full diff:
E           {
E               'accept_hooks': False,
E         +     'checkout': None,
E               'config_file': None,
E               'default_config': False,
E               'directory': None,
E               'extra_context': None,
E               'keep_project_on_failure': False,
E         +     'no_input': False,
E               'output_dir': '/tmp/pytest-of-root/pytest-0/test_cli_accept_hooks___output3/output',
E               'overwrite_if_exists': False,
E               'password': None,
E               'replay': False,
E         +     'replay_file': None,
E               'skip_if_file_exists': False,
E           }

tests/test_cli.py:657: AssertionError

test_cli.py::test_cli_with_json_decoding_error

test_cli.py::test_cli_with_json_decoding_error
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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

        # Validate the error message.
        # original message from json module should be included
        pattern = 'Expecting \'{0,1}:\'{0,1} delimiter: line 1 column (19|20) \\(char 19\\)'
>       assert re.search(pattern, result.output)
E       assert None
E        +  where None = ("Expecting '{0,1}:'{0,1} delimiter: line 1 column (19|20) \\(char 19\\)", '')
E        +    where  = re.search
E        +    and   '' = .output

tests/test_cli.py:685: AssertionError

test_cli.py::test_cli_with_pre_prompt_hook

test_cli.py::test_cli_with_pre_prompt_hook
cli_runner = .cli_main at 0x7f6a6fb25cf0>

    @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
E       assert 1 == 0
E        +  where 1 = .exit_code

tests/test_cli.py:699: AssertionError

test_cookiecutter_invocation.py::test_should_invoke_main

test_cookiecutter_invocation.py::test_should_invoke_main
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6f9af1c0>
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 = (['/testbed/.venv/bin/python3', '-m', 'cookiecutter.cli', 'tests/fake-repo-tmpl', '--no-input'],)
kwargs = {}, retcode = 1
cmd = ['/testbed/.venv/bin/python3', '-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 '['/testbed/.venv/bin/python3', '-m', 'cookiecutter.cli', 'tests/fake-repo-tmpl', '--no-input']' returned non-zero exit status 1.

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

]

]
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)

tests/test_cookiecutter_local_no_input.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-pre/', checkout = None, no_input = True
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '.', config_file = None, default_config = False, password = None
directory = None, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

fake-repo-pre]

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)

tests/test_cookiecutter_local_no_input.py:39: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-pre', checkout = None, no_input = True
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '.', config_file = None, default_config = False, password = None
directory = None, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_extra_context

test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_extra_context
@pytest.mark.usefixtures('clean_system', 'remove_additional_dirs')
    def test_cookiecutter_no_input_extra_context():
        """Verify `cookiecutter` accept `extra_context` argument."""
>       main.cookiecutter(
            'tests/fake-repo-pre',
            no_input=True,
            extra_context={'repo_name': 'fake-project-extra'},
        )

tests/test_cookiecutter_local_no_input.py:50: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-pre', checkout = None, no_input = True
extra_context = {'repo_name': 'fake-project-extra'}, replay = None
overwrite_if_exists = False, output_dir = '.', config_file = None
default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_cookiecutter_local_no_input.py::test_cookiecutter_templated_context

test_cookiecutter_local_no_input.py::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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-tmpl', checkout = None, no_input = True
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '.', config_file = None, default_config = False, password = None
directory = None, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_cookiecutter_local_no_input.py::test_cookiecutter_no_input_return_rendered_file

test_cookiecutter_local_no_input.py::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)

tests/test_cookiecutter_local_no_input.py:68: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-pre', checkout = None, no_input = True
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '.', config_file = None, default_config = False, password = None
directory = None, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_cookiecutter_local_no_input.py::test_cookiecutter_dict_values_in_context

test_cookiecutter_local_no_input.py::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)

tests/test_cookiecutter_local_no_input.py:77: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-dict', checkout = None, no_input = True
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '.', config_file = None, default_config = False, password = None
directory = None, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_cookiecutter_local_no_input.py::test_cookiecutter_template_cleanup

test_cookiecutter_local_no_input.py::test_cookiecutter_template_cleanup
mocker = 

    @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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/files/fake-repo-tmpl.zip', checkout = None, no_input = True
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '.', config_file = None, default_config = False, password = None
directory = None, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_cookiecutter_local_with_input.py::test_cookiecutter_local_with_input

test_cookiecutter_local_with_input.py::test_cookiecutter_local_with_input
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6fa4f970>

    @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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-pre/', checkout = None, no_input = False
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '.', config_file = None, default_config = False, password = None
directory = None, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_cookiecutter_local_with_input.py::test_cookiecutter_input_extra_context

test_cookiecutter_local_with_input.py::test_cookiecutter_input_extra_context
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a700eed70>

    @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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/fake-repo-pre', checkout = None, no_input = False
extra_context = {'repo_name': 'fake-project-input-extra'}, replay = None
overwrite_if_exists = False, output_dir = '.', config_file = None
default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_cookiecutter_nested_templates.py::test_cookiecutter_nested_templates[fake-nested-templates-fake-project]

test_cookiecutter_nested_templates.py::test_cookiecutter_nested_templates[fake-nested-templates-fake-project]
mocker = 
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)

tests/test_cookiecutter_nested_templates.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = '/testbed/tests/fake-nested-templates', checkout = None
no_input = True, extra_context = None, replay = None
overwrite_if_exists = False, output_dir = '.', config_file = None
default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_cookiecutter_nested_templates.py::test_cookiecutter_nested_templates[fake-nested-templates-old-style-fake-package]

test_cookiecutter_nested_templates.py::test_cookiecutter_nested_templates[fake-nested-templates-old-style-fake-package]
mocker = 
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)

tests/test_cookiecutter_nested_templates.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = '/testbed/tests/fake-nested-templates-old-style', checkout = None
no_input = True, extra_context = None, replay = None
overwrite_if_exists = False, output_dir = '.', config_file = None
default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_custom_extensions_in_hooks.py::test_hook_with_extension[pre_gen_hook]

test_custom_extensions_in_hooks.py::test_hook_with_extension[pre_gen_hook]
template = 'tests/test-extensions/custom-extension-pre'
output_dir = '/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/test-extensions/custom-extension-pre', checkout = None
no_input = True
extra_context = {'name': 'Cookiemonster', 'project_slug': 'foobar'}
replay = None, overwrite_if_exists = False
output_dir = '/tmp/pytest-of-root/pytest-0/test_hook_with_extension_pre_g0/output'
config_file = None, default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_custom_extensions_in_hooks.py::test_hook_with_extension[post_gen_hook]

test_custom_extensions_in_hooks.py::test_hook_with_extension[post_gen_hook]
template = 'tests/test-extensions/custom-extension-post'
output_dir = '/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/test-extensions/custom-extension-post', checkout = None
no_input = True
extra_context = {'name': 'Cookiemonster', 'project_slug': 'foobar'}
replay = None, overwrite_if_exists = False
output_dir = '/tmp/pytest-of-root/pytest-0/test_hook_with_extension_post_0/output'
config_file = None, default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_default_extensions.py::test_jinja2_time_extension

test_default_extensions.py::test_jinja2_time_extension
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/test-extensions/default/', checkout = None, no_input = True
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '/tmp/pytest-of-root/pytest-0/test_jinja2_time_extension0'
config_file = None, default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_default_extensions.py::test_jinja2_slugify_extension

test_default_extensions.py::test_jinja2_slugify_extension
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/test-extensions/default/', checkout = None, no_input = True
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '/tmp/pytest-of-root/pytest-0/test_jinja2_slugify_extension0'
config_file = None, default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_default_extensions.py::test_jinja2_uuid_extension

test_default_extensions.py::test_jinja2_uuid_extension
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = 'tests/test-extensions/default/', checkout = None, no_input = True
extra_context = None, replay = None, overwrite_if_exists = False
output_dir = '/tmp/pytest-of-root/pytest-0/test_jinja2_uuid_extension0'
config_file = None, default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

cookiecutter/main.py:65: TypeError

test_find.py::test_find_template[template with default jinja strings]

test_find.py::test_find_template[template with default jinja strings]
repo_name = 'fake-repo-pre', env = None
error_expectation = 
expected = '{{cookiecutter.repo_name}}'

    @pytest.mark.parametrize(
        "repo_name,context,error_expectation,expected",
        [
            ("fake-repo-pre", {}, does_not_raise(), '{{cookiecutter.repo_name}}'),
            (
                "fake-repo-pre2",
                {
                    'cookiecutter': {
                        '_jinja2_env_vars': {
                            'variable_start_string': '{%{',
                            'variable_end_string': '}%}',
                        }
                    }
                },
                does_not_raise(),
                '{%{cookiecutter.repo_name}%}',
            ),
            (
                "fake-repo-pre",
                {
                    'cookiecutter': {
                        '_jinja2_env_vars': {
                            'variable_start_string': '{%{',
                            'variable_end_string': '}%}',
                        }
                    }
                },
                pytest.raises(NonTemplatedInputDirException),
                None,
            ),
            ("fake-repo-bad", {}, pytest.raises(NonTemplatedInputDirException), None),
        ],
        ids=[
            'template with default jinja strings',
            'template with custom jinja strings',
            'template with custom jinja strings but folder with default jinja strings',
            'template missing folder',
        ],
    )
    def test_find_template(repo_name, env, error_expectation, expected):
        """Verify correctness of `find.find_template` path detection."""
        repo_dir = Path('tests', repo_name)

        with error_expectation:
            template = find.find_template(repo_dir, env)

            test_dir = Path(repo_dir, expected)
>           assert template == test_dir
E           AssertionError: assert PosixPath('tests/fake-repo-pre') == PosixPath('tests/fake-repo-pre/{{cookiecutter.repo_name}}')

tests/test_find.py:72: AssertionError

test_find.py::test_find_template[template with custom jinja strings]

test_find.py::test_find_template[template with custom jinja strings]
repo_name = 'fake-repo-pre2', env = None
error_expectation = 
expected = '{%{cookiecutter.repo_name}%}'

    @pytest.mark.parametrize(
        "repo_name,context,error_expectation,expected",
        [
            ("fake-repo-pre", {}, does_not_raise(), '{{cookiecutter.repo_name}}'),
            (
                "fake-repo-pre2",
                {
                    'cookiecutter': {
                        '_jinja2_env_vars': {
                            'variable_start_string': '{%{',
                            'variable_end_string': '}%}',
                        }
                    }
                },
                does_not_raise(),
                '{%{cookiecutter.repo_name}%}',
            ),
            (
                "fake-repo-pre",
                {
                    'cookiecutter': {
                        '_jinja2_env_vars': {
                            'variable_start_string': '{%{',
                            'variable_end_string': '}%}',
                        }
                    }
                },
                pytest.raises(NonTemplatedInputDirException),
                None,
            ),
            ("fake-repo-bad", {}, pytest.raises(NonTemplatedInputDirException), None),
        ],
        ids=[
            'template with default jinja strings',
            'template with custom jinja strings',
            'template with custom jinja strings but folder with default jinja strings',
            'template missing folder',
        ],
    )
    def test_find_template(repo_name, env, error_expectation, expected):
        """Verify correctness of `find.find_template` path detection."""
        repo_dir = Path('tests', repo_name)

        with error_expectation:
            template = find.find_template(repo_dir, env)

            test_dir = Path(repo_dir, expected)
>           assert template == test_dir
E           AssertionError: assert PosixPath('tests/fake-repo-pre2') == PosixPath('tests/fake-repo-pre2/{%{cookiecutter.repo_name}%}')

tests/test_find.py:72: AssertionError

test_find.py::test_find_template[template with custom jinja strings but folder with default jinja strings]

test_find.py::test_find_template[template with custom jinja strings but folder with default jinja strings]
repo_name = 'fake-repo-pre', env = None
error_expectation = <_pytest.python_api.RaisesContext object at 0x7f6a71894100>
expected = None

    @pytest.mark.parametrize(
        "repo_name,context,error_expectation,expected",
        [
            ("fake-repo-pre", {}, does_not_raise(), '{{cookiecutter.repo_name}}'),
            (
                "fake-repo-pre2",
                {
                    'cookiecutter': {
                        '_jinja2_env_vars': {
                            'variable_start_string': '{%{',
                            'variable_end_string': '}%}',
                        }
                    }
                },
                does_not_raise(),
                '{%{cookiecutter.repo_name}%}',
            ),
            (
                "fake-repo-pre",
                {
                    'cookiecutter': {
                        '_jinja2_env_vars': {
                            'variable_start_string': '{%{',
                            'variable_end_string': '}%}',
                        }
                    }
                },
                pytest.raises(NonTemplatedInputDirException),
                None,
            ),
            ("fake-repo-bad", {}, pytest.raises(NonTemplatedInputDirException), None),
        ],
        ids=[
            'template with default jinja strings',
            'template with custom jinja strings',
            'template with custom jinja strings but folder with default jinja strings',
            'template missing folder',
        ],
    )
    def test_find_template(repo_name, env, error_expectation, expected):
        """Verify correctness of `find.find_template` path detection."""
        repo_dir = Path('tests', repo_name)

        with error_expectation:
            template = find.find_template(repo_dir, env)

>           test_dir = Path(repo_dir, expected)

tests/test_find.py:71: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib/python3.10/pathlib.py:960: in __new__
    self = cls._from_parts(args)
/usr/lib/python3.10/pathlib.py:594: in _from_parts
    drv, root, parts = self._parse_args(args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = 
args = (PosixPath('tests/fake-repo-pre'), None)

    @classmethod
    def _parse_args(cls, args):
        # This is useful when you don't want to create an instance, just
        # canonicalize some constructor arguments.
        parts = []
        for a in args:
            if isinstance(a, PurePath):
                parts += a._parts
            else:
>               a = os.fspath(a)
E               TypeError: expected str, bytes or os.PathLike object, not NoneType

/usr/lib/python3.10/pathlib.py:578: TypeError

test_generate_context.py::test_generate_context[input_params0-expected_context0]

test_generate_context.py::test_generate_context[input_params0-expected_context0]
input_params = {'context_file': 'tests/test-generate-context/test.json'}
expected_context = {'test': {'1': 2, 'some_key': 'some_val'}}

    @pytest.mark.usefixtures('clean_system')
    @pytest.mark.parametrize('input_params, expected_context', context_data())
    def test_generate_context(input_params, expected_context):
        """Verify input contexts combinations result in expected content on output."""
>       assert generate.generate_context(**input_params) == expected_context
E       AssertionError: assert {'cookiecutter': OrderedDict([('1', 2), ('some_key', 'some_val')])} == {'test': {'1': 2, 'some_key': 'some_val'}}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('1', 2), ('some_key', 'some_val')])}
E         Right contains 1 more item:
E         {'test': {'1': 2, 'some_key': 'some_val'}}
E         
E         Full diff:
E           {
E         -     'test': {
E         +     'cookiecutter': OrderedDict({
E                   '1': 2,
E                   'some_key': 'some_val',
E         -     },
E         +     }),
E         ?      +
E           }

tests/test_generate_context.py:58: AssertionError

test_generate_context.py::test_generate_context[input_params1-expected_context1]

test_generate_context.py::test_generate_context[input_params1-expected_context1]
input_params = {'context_file': 'tests/test-generate-context/test.json', 'default_context': {'1': 3}}
expected_context = {'test': {'1': 3, 'some_key': 'some_val'}}

    @pytest.mark.usefixtures('clean_system')
    @pytest.mark.parametrize('input_params, expected_context', context_data())
    def test_generate_context(input_params, expected_context):
        """Verify input contexts combinations result in expected content on output."""
>       assert generate.generate_context(**input_params) == expected_context
E       AssertionError: assert {'cookiecutter': OrderedDict([('1', 3), ('some_key', 'some_val')])} == {'test': {'1': 3, 'some_key': 'some_val'}}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('1', 3), ('some_key', 'some_val')])}
E         Right contains 1 more item:
E         {'test': {'1': 3, 'some_key': 'some_val'}}
E         
E         Full diff:
E           {
E         -     'test': {
E         +     'cookiecutter': OrderedDict({
E                   '1': 3,
E                   'some_key': 'some_val',
E         -     },
E         +     }),
E         ?      +
E           }

tests/test_generate_context.py:58: AssertionError

test_generate_context.py::test_generate_context[input_params2-expected_context2]

test_generate_context.py::test_generate_context[input_params2-expected_context2]
input_params = {'context_file': 'tests/test-generate-context/test.json', 'extra_context': {'1': 4}}
expected_context = {'test': {'1': 4, 'some_key': 'some_val'}}

    @pytest.mark.usefixtures('clean_system')
    @pytest.mark.parametrize('input_params, expected_context', context_data())
    def test_generate_context(input_params, expected_context):
        """Verify input contexts combinations result in expected content on output."""
>       assert generate.generate_context(**input_params) == expected_context
E       AssertionError: assert {'cookiecutter': OrderedDict([('1', 4), ('some_key', 'some_val')])} == {'test': {'1': 4, 'some_key': 'some_val'}}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('1', 4), ('some_key', 'some_val')])}
E         Right contains 1 more item:
E         {'test': {'1': 4, 'some_key': 'some_val'}}
E         
E         Full diff:
E           {
E         -     'test': {
E         +     'cookiecutter': OrderedDict({
E                   '1': 4,
E                   'some_key': 'some_val',
E         -     },
E         +     }),
E         ?      +
E           }

tests/test_generate_context.py:58: AssertionError

test_generate_context.py::test_generate_context[input_params3-expected_context3]

test_generate_context.py::test_generate_context[input_params3-expected_context3]
input_params = {'context_file': 'tests/test-generate-context/test.json', 'default_context': {'1': 3}, 'extra_context': {'1': 5}}
expected_context = {'test': {'1': 5, 'some_key': 'some_val'}}

    @pytest.mark.usefixtures('clean_system')
    @pytest.mark.parametrize('input_params, expected_context', context_data())
    def test_generate_context(input_params, expected_context):
        """Verify input contexts combinations result in expected content on output."""
>       assert generate.generate_context(**input_params) == expected_context
E       AssertionError: assert {'cookiecutter': OrderedDict([('1', 5), ('some_key', 'some_val')])} == {'test': {'1': 5, 'some_key': 'some_val'}}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('1', 5), ('some_key', 'some_val')])}
E         Right contains 1 more item:
E         {'test': {'1': 5, 'some_key': 'some_val'}}
E         
E         Full diff:
E           {
E         -     'test': {
E         +     'cookiecutter': OrderedDict({
E                   '1': 5,
E                   'some_key': 'some_val',
E         -     },
E         +     }),
E         ?      +
E           }

tests/test_generate_context.py:58: AssertionError

test_generate_context.py::test_default_context_replacement_in_generate_context

test_generate_context.py::test_default_context_replacement_in_generate_context
def test_default_context_replacement_in_generate_context():
        """Verify default content settings are correctly replaced by template settings.

        Make sure that the default for list variables of `orientation` is based on
        the user config (`choices_template.json`) and not changed to a single value
        from `default_context`.
        """
        expected_context = {
            'choices_template': OrderedDict(
                [
                    ('full_name', 'Raphael Pierzina'),
                    ('github_username', 'hackebrot'),
                    ('project_name', 'Kivy Project'),
                    ('repo_name', '{{cookiecutter.project_name|lower}}'),
                    ('orientation', ['landscape', 'all', 'portrait']),
                ]
            )
        }

        generated_context = generate.generate_context(
            context_file='tests/test-generate-context/choices_template.json',
            default_context={
                'not_in_template': 'foobar',
                'project_name': 'Kivy Project',
                'orientation': 'landscape',
            },
            extra_context={
                'also_not_in_template': 'foobar2',
                'github_username': 'hackebrot',
            },
        )

>       assert generated_context == expected_context
E       AssertionError: assert {'cookiecutter': OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project_name', 'Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', 'landscape'), ('not_in_template', 'foobar'), ('also_not_in_template', 'foobar2')])} == {'choices_template': OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project_name', 'Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', ['landscape', 'all', 'portrait'])])}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('full_name', 'Raphael Pierzina'),
E                                       ('github_username', 'hackebrot'),
E                                       ('project_name', 'Kivy Project'),
E                                       ('repo_name',
E                                        '{{cookiecutter.project_name|lower}}'),
E                                       ('orientation', 'landscape'),
E                                       ('not_in_template', 'foobar'),
E                                       ('also_not_in_template', 'foobar2')])}
E         Right contains 1 more item:
E         {'choices_template': OrderedDict([('full_name', 'Raphael Pierzina'),
E                                           ('github_username', 'hackebrot'),
E                                           ('project_name', 'Kivy Project'),
E                                           ('repo_name',
E                                            '{{cookiecutter.project_name|lower}}'),
E                                           ('orientation',
E                                            ['landscape', 'all', 'portrait'])])}
E         
E         Full diff:
E           {
E         -     'choices_template': OrderedDict({
E         ?       -   ^^^  ^^^^^^
E         +     'cookiecutter': OrderedDict({
E         ?        ++ + ^^  ^
E         +         'also_not_in_template': 'foobar2',
E                   'full_name': 'Raphael Pierzina',
E                   'github_username': 'hackebrot',
E         +         'not_in_template': 'foobar',
E         -         'orientation': [
E         ?                        ^
E         +         'orientation': 'landscape',
E         ?                        ^^^^^^^^^^^^
E         -             'landscape',
E         -             'all',
E         -             'portrait',
E         -         ],
E                   'project_name': 'Kivy Project',
E                   'repo_name': '{{cookiecutter.project_name|lower}}',
E               }),
E           }

tests/test_generate_context.py:109: AssertionError

test_generate_context.py::test_generate_context_decodes_non_ascii_chars

test_generate_context.py::test_generate_context_decodes_non_ascii_chars
def test_generate_context_decodes_non_ascii_chars():
        """Verify `generate_context` correctly decodes non-ascii chars."""
        expected_context = {
            'non_ascii': OrderedDict(
                [
                    ('full_name', 'éèà'),
                ]
            )
        }

        generated_context = generate.generate_context(
            context_file='tests/test-generate-context/non_ascii.json'
        )

>       assert generated_context == expected_context
E       AssertionError: assert {'cookiecutter': OrderedDict([('full_name', 'éèà')])} == {'non_ascii': OrderedDict([('full_name', 'éèà')])}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('full_name', 'éèà')])}
E         Right contains 1 more item:
E         {'non_ascii': OrderedDict([('full_name', 'éèà')])}
E         
E         Full diff:
E           {
E         -     'non_ascii': OrderedDict({
E         +     'cookiecutter': OrderedDict({
E                   'full_name': 'éèà',
E               }),
E           }

tests/test_generate_context.py:126: AssertionError

test_generate_context.py::test_apply_overwrites_does_include_unused_variables

test_generate_context.py::test_apply_overwrites_does_include_unused_variables
template_context = OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project_name', 'Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', ['all', 'landscape', 'portrait']), ('deployment_regions', ['eu', 'us', 'ap']), ('deployments', {'preprod': ['eu', 'us', 'ap'], 'prod': ['eu', 'us', 'ap']}), ('not in template', 'foobar')])

    def test_apply_overwrites_does_include_unused_variables(template_context):
        """Verify `apply_overwrites_to_context` skips variables that are not in context."""
        generate.apply_overwrites_to_context(
            context=template_context, overwrite_context={'not in template': 'foobar'}
        )

>       assert 'not in template' not in template_context
E       AssertionError: assert 'not in template' not in OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project_name', 'Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', ['all', 'landscape', 'portrait']), ('deployment_regions', ['eu', 'us', 'ap']), ('deployments', {'preprod': ['eu', 'us', 'ap'], 'prod': ['eu', 'us', 'ap']}), ('not in template', 'foobar')])

tests/test_generate_context.py:157: AssertionError

test_generate_context.py::test_apply_overwrites_does_not_modify_choices_for_invalid_overwrite

test_generate_context.py::test_apply_overwrites_does_not_modify_choices_for_invalid_overwrite
def test_apply_overwrites_does_not_modify_choices_for_invalid_overwrite():
        """Verify variables overwrite for list if variable not in list ignored."""
        expected_context = {
            'choices_template': OrderedDict(
                [
                    ('full_name', 'Raphael Pierzina'),
                    ('github_username', 'hackebrot'),
                    ('project_name', 'Kivy Project'),
                    ('repo_name', '{{cookiecutter.project_name|lower}}'),
                    ('orientation', ['all', 'landscape', 'portrait']),
                ]
            )
        }

>       with pytest.warns(UserWarning, match="Invalid default received"):
E       Failed: DID NOT WARN. No warnings of type (,) were emitted.
E        Emitted warnings: [].

tests/test_generate_context.py:183: Failed

test_generate_context.py::test_apply_overwrites_invalid_overwrite

test_generate_context.py::test_apply_overwrites_invalid_overwrite
template_context = OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project_name', 'Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', 'foobar'), ('deployment_regions', ['eu', 'us', 'ap']), ('deployments', {'preprod': ['eu', 'us', 'ap'], 'prod': ['eu', 'us', 'ap']})])

    def test_apply_overwrites_invalid_overwrite(template_context):
        """Verify variables overwrite for list if variable not in list not ignored."""
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

tests/test_generate_context.py:202: Failed

test_generate_context.py::test_apply_overwrites_invalid_multichoice_values

test_generate_context.py::test_apply_overwrites_invalid_multichoice_values
template_context = OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project_name', 'Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', ['all', 'landscape', 'portrait']), ('deployment_regions', ['na']), ('deployments', {'preprod': ['eu', 'us', 'ap'], 'prod': ['eu', 'us', 'ap']})])

    def test_apply_overwrites_invalid_multichoice_values(template_context):
        """Verify variable overwrite for list given invalid list entries not ignored."""
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

tests/test_generate_context.py:219: Failed

test_generate_context.py::test_apply_overwrites_error_additional_values

test_generate_context.py::test_apply_overwrites_error_additional_values
template_context = OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project_name', 'Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', ['all', 'landscape', 'portrait']), ('deployment_regions', ['eu', 'na']), ('deployments', {'preprod': ['eu', 'us', 'ap'], 'prod': ['eu', 'us', 'ap']})])

    def test_apply_overwrites_error_additional_values(template_context):
        """Verify variable overwrite for list given additional entries not ignored."""
>       with pytest.raises(ValueError):
E       Failed: DID NOT RAISE 

tests/test_generate_context.py:228: Failed

test_generate_context.py::test_apply_overwrites_sets_default_for_choice_variable

test_generate_context.py::test_apply_overwrites_sets_default_for_choice_variable
template_context = OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project_name', 'Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', 'landscape'), ('deployment_regions', ['eu', 'us', 'ap']), ('deployments', {'preprod': ['eu', 'us', 'ap'], 'prod': ['eu', 'us', 'ap']})])

    def test_apply_overwrites_sets_default_for_choice_variable(template_context):
        """Verify overwritten list member became a default value."""
        generate.apply_overwrites_to_context(
            context=template_context, overwrite_context={'orientation': 'landscape'}
        )

>       assert template_context['orientation'] == ['landscape', 'all', 'portrait']
E       AssertionError: assert 'landscape' == ['landscape', 'all', 'portrait']

tests/test_generate_context.py:251: AssertionError

test_generate_context.py::test_apply_overwrites_in_nested_dict

test_generate_context.py::test_apply_overwrites_in_nested_dict
def test_apply_overwrites_in_nested_dict():
        """Verify nested dict in default content settings are correctly replaced."""
        expected_context = {
            'nested_dict': OrderedDict(
                [
                    ('full_name', 'Raphael Pierzina'),
                    ('github_username', 'hackebrot'),
                    (
                        'project',
                        OrderedDict(
                            [
                                ('name', 'My Kivy Project'),
                                ('description', 'My Kivy Project'),
                                ('repo_name', '{{cookiecutter.project_name|lower}}'),
                                ('orientation', ["all", "landscape", "portrait"]),
                            ]
                        ),
                    ),
                ]
            )
        }

        generated_context = generate.generate_context(
            context_file='tests/test-generate-context/nested_dict.json',
            default_context={
                'not_in_template': 'foobar',
                'project': {
                    'description': 'My Kivy Project',
                },
            },
            extra_context={
                'also_not_in_template': 'foobar2',
                'github_username': 'hackebrot',
                'project': {
                    'name': 'My Kivy Project',
                },
            },
        )

>       assert generated_context == expected_context
E       AssertionError: assert {'cookiecutter': OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project', OrderedDict([('name', 'My Kivy Project'), ('description', 'My Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', ['all', 'landscape', 'portrait'])])), ('not_in_template', 'foobar'), ('also_not_in_template', 'foobar2')])} == {'nested_dict': OrderedDict([('full_name', 'Raphael Pierzina'), ('github_username', 'hackebrot'), ('project', OrderedDict([('name', 'My Kivy Project'), ('description', 'My Kivy Project'), ('repo_name', '{{cookiecutter.project_name|lower}}'), ('orientation', ['all', 'landscape', 'portrait'])]))])}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('full_name', 'Raphael Pierzina'),
E                                       ('github_username', 'hackebrot'),
E                                       ('project',
E                                        OrderedDict([('name', 'My Kivy Project'),
E                                                     ('description', 'My Kivy Project'),
E                                                     ('repo_name',
E                                                      '{{cookiecutter.project_name|lower}}'),
E                                                     ('orientation',
E                                                      ['all',
E                                                       'landscape',
E                                                       'portrait'])])),
E                                       ('not_in_template', 'foobar'),
E                                       ('also_not_in_template', 'foobar2')])}
E         Right contains 1 more item:
E         {'nested_dict': OrderedDict([('full_name', 'Raphael Pierzina'),
E                                      ('github_username', 'hackebrot'),
E                                      ('project',
E                                       OrderedDict([('name', 'My Kivy Project'),
E                                                    ('description', 'My Kivy Project'),
E                                                    ('repo_name',
E                                                     '{{cookiecutter.project_name|lower}}'),
E                                                    ('orientation',
E                                                     ['all',
E                                                      'landscape',
E                                                      'portrait'])]))])}
E         
E         Full diff:
E           {
E         -     'nested_dict': OrderedDict({
E         +     'cookiecutter': OrderedDict({
E         +         'also_not_in_template': 'foobar2',
E                   'full_name': 'Raphael Pierzina',
E                   'github_username': 'hackebrot',
E         +         'not_in_template': 'foobar',
E                   'project': OrderedDict({
E                       'description': 'My Kivy Project',
E                       'name': 'My Kivy Project',
E                       'orientation': [
E                           'all',
E                           'landscape',
E                           'portrait',
E                       ],
E                       'repo_name': '{{cookiecutter.project_name|lower}}',
E                   }),
E               }),
E           }

tests/test_generate_context.py:293: AssertionError

test_generate_context.py::test_apply_overwrites_in_nested_dict_additional_values

test_generate_context.py::test_apply_overwrites_in_nested_dict_additional_values
def test_apply_overwrites_in_nested_dict_additional_values():
        """Verify nested dict in default content settings are correctly added."""
        expected_context = {
            'nested_dict_additional': OrderedDict(
                [
                    ('mainkey1', 'mainvalue1'),
                    (
                        'mainkey2',
                        OrderedDict(
                            [
                                ('subkey1', 'subvalue1'),
                                (
                                    'subkey2',
                                    OrderedDict(
                                        [
                                            ('subsubkey1', 'subsubvalue1'),
                                            ('subsubkey2', 'subsubvalue2_default'),
                                            ('subsubkey3', 'subsubvalue3_extra'),
                                        ]
                                    ),
                                ),
                                ('subkey4', 'subvalue4_default'),
                                ('subkey5', 'subvalue5_extra'),
                            ]
                        ),
                    ),
                ]
            )
        }

        generated_context = generate.generate_context(
            context_file='tests/test-generate-context/nested_dict_additional.json',
            default_context={
                'not_in_template': 'foobar',
                'mainkey2': {
                    'subkey2': {
                        'subsubkey2': 'subsubvalue2_default',
                    },
                    'subkey4': 'subvalue4_default',
                },
            },
            extra_context={
                'also_not_in_template': 'foobar2',
                'mainkey2': {
                    'subkey2': {
                        'subsubkey3': 'subsubvalue3_extra',
                    },
                    'subkey5': 'subvalue5_extra',
                },
            },
        )

>       assert generated_context == expected_context
E       AssertionError: assert {'cookiecutter': OrderedDict([('mainkey1', 'mainvalue1'), ('mainkey2', OrderedDict([('subkey1', 'subvalue1'), ('subkey2', OrderedDict([('subsubkey1', 'subsubvalue1'), ('subsubkey2', 'subsubvalue2_default'), ('subsubkey3', 'subsubvalue3_extra')])), ('subkey4', 'subvalue4_default'), ('subkey5', 'subvalue5_extra')])), ('not_in_template', 'foobar'), ('also_not_in_template', 'foobar2')])} == {'nested_dict_additional': OrderedDict([('mainkey1', 'mainvalue1'), ('mainkey2', OrderedDict([('subkey1', 'subvalue1'), ('subkey2', OrderedDict([('subsubkey1', 'subsubvalue1'), ('subsubkey2', 'subsubvalue2_default'), ('subsubkey3', 'subsubvalue3_extra')])), ('subkey4', 'subvalue4_default'), ('subkey5', 'subvalue5_extra')]))])}
E         
E         Left contains 1 more item:
E         {'cookiecutter': OrderedDict([('mainkey1', 'mainvalue1'),
E                                       ('mainkey2',
E                                        OrderedDict([('subkey1', 'subvalue1'),
E                                                     ('subkey2',
E                                                      OrderedDict([('subsubkey1',
E                                                                    'subsubvalue1'),
E                                                                   ('subsubkey2',
E                                                                    'subsubvalue2_default'),
E                                                                   ('subsubkey3',
E                                                                    'subsubvalue3_extra')])),
E                                                     ('subkey4', 'subvalue4_default'),
E                                                     ('subkey5', 'subvalue5_extra')])),
E                                       ('not_in_template', 'foobar'),
E                                       ('also_not_in_template', 'foobar2')])}
E         Right contains 1 more item:
E         {'nested_dict_additional': OrderedDict([('mainkey1', 'mainvalue1'),
E                                                 ('mainkey2',
E                                                  OrderedDict([('subkey1', 'subvalue1'),
E                                                               ('subkey2',
E                                                                OrderedDict([('subsubkey1',
E                                                                              'subsubvalue1'),
E                                                                             ('subsubkey2',
E                                                                              'subsubvalue2_default'),
E                                                                             ('subsubkey3',
E                                                                              'subsubvalue3_extra')])),
E                                                               ('subkey4',
E                                                                'subvalue4_default'),
E                                                               ('subkey5',
E                                                                'subvalue5_extra')]))])}
E         
E         Full diff:
E           {
E         -     'nested_dict_additional': OrderedDict({
E         +     'cookiecutter': OrderedDict({
E         +         'also_not_in_template': 'foobar2',
E                   'mainkey1': 'mainvalue1',
E                   'mainkey2': OrderedDict({
E                       'subkey1': 'subvalue1',
E                       'subkey2': OrderedDict({
E                           'subsubkey1': 'subsubvalue1',
E                           'subsubkey2': 'subsubvalue2_default',
E                           'subsubkey3': 'subsubvalue3_extra',
E                       }),
E                       'subkey4': 'subvalue4_default',
E                       'subkey5': 'subvalue5_extra',
E                   }),
E         +         'not_in_template': 'foobar',
E               }),
E           }

tests/test_generate_context.py:364: AssertionError

test_generate_copy_without_render.py::test_generate_copy_without_render_extensions

test_generate_copy_without_render.py::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',
        )

tests/test_generate_copy_without_render.py:26: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-copy-without-render'
context = {'cookiecutter': {'_copy_without_render': ['*not-rendered', 'rendered/not_rendered.yml', '*.txt', '{{cookiecutter.repo_name}}-rendered/README.md'], 'render_test': 'I have been rendered!', 'repo_name': 'test_copy_without_render'}}
output_dir = '.', overwrite_if_exists = False, skip_if_file_exists = False
accept_hooks = True, keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_copy_without_render_override.py::test_generate_copy_without_render_extensions

test_generate_copy_without_render_override.py::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',
        )

tests/test_generate_copy_without_render_override.py:27: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-copy-without-render-override'
context = {'cookiecutter': {'_copy_without_render': ['*not-rendered', 'rendered/not_rendered.yml', '*.txt', '{{cookiecutter.repo_name}}-rendered/README.md'], 'render_test': 'I have been rendered!', 'repo_name': 'test_copy_without_render'}}
output_dir = '.', overwrite_if_exists = False, skip_if_file_exists = False
accept_hooks = True, keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_file.py::test_generate_file_with_false_condition

test_generate_file.py::test_generate_file_with_false_condition
env = 

    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 = 
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.
        """
        logger.debug('Processing file %s', infile)

        # Render the path to the output file (not the contents of the input file)
        outfile_tmpl = env.from_string(infile)
        outfile = outfile_tmpl.render(**context)
        outfile_path = os.path.join(project_dir, outfile)

        # Skip if file exists
        if skip_if_file_exists and os.path.exists(outfile_path):
            logger.debug('File %s already exists, skipping', outfile)
            return []

        # Create the parent directory if it doesn't exist
        parent_dir = os.path.dirname(outfile_path)
        if parent_dir and not os.path.exists(parent_dir):
            make_sure_path_exists(parent_dir)

        # Just copy over binary files without rendering
        logger.debug("Check %s to see if it's a binary", infile)
        if is_binary(infile) or is_copy_only_path(infile, context):
            logger.debug('Copying binary %s to %s without rendering', infile, outfile)
            shutil.copyfile(infile, outfile_path)
            return [outfile_path]

        # For text files, render the contents and write the rendered file
        try:
            with open(infile, encoding='utf-8') as f:
                tmpl = env.from_string(f.read())
            rendered_file = tmpl.render(**context)

            logger.debug('Writing %s', outfile)
>           with open(outfile_path, 'w', encoding='utf-8') as fh:
E           IsADirectoryError: [Errno 21] Is a directory: './tests/files/'

cookiecutter/generate.py:134: IsADirectoryError

test_generate_file.py::test_generate_file_verbose_template_syntax_error

test_generate_file.py::test_generate_file_verbose_template_syntax_error
env = 
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 = ('Missing end of comment tag\n  File "tests/files/syntax_error.txt", line 1')
E        +    where  = 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\n  File "tests/files/syntax_error.txt", line 1' = str(TemplateSyntaxError('Missing end of comment tag'))
E        +      where TemplateSyntaxError('Missing end of comment tag') = .value

tests/test_generate_file.py:138: AssertionError

test_generate_file.py::test_generate_file_does_not_translate_crlf_newlines_to_lf

test_generate_file.py::test_generate_file_does_not_translate_crlf_newlines_to_lf
env = 

    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.py::test_generate_files_nontemplated_exception

test_generate_files.py::test_generate_files_nontemplated_exception
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_nontemplat0')

    def test_generate_files_nontemplated_exception(tmp_path):
        """
        Verify `generate_files` raises when no directories to render exist.

        Note: Check `tests/test-generate-files-nontemplated` location to understand.
        """
        with pytest.raises(exceptions.NonTemplatedInputDirException):
>           generate.generate_files(
                context={'cookiecutter': {'food': 'pizza'}},
                repo_dir='tests/test-generate-files-nontemplated',
                output_dir=tmp_path,
            )

tests/test_generate_files.py:22: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files-nontemplated'
context = {'cookiecutter': {'food': 'pizza'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_nontemplat0')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files

test_generate_files.py::test_generate_files
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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,
        )

tests/test_generate_files.py:31: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files'
context = {'cookiecutter': {'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files0')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_with_linux_newline

test_generate_files.py::test_generate_files_with_linux_newline
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_linux0')

    def test_generate_files_with_linux_newline(tmp_path):
        """Verify new line not removed by templating engine after folder generation."""
>       generate.generate_files(
            context={'cookiecutter': {'food': 'pizzä'}},
            repo_dir='tests/test-generate-files',
            output_dir=tmp_path,
        )

tests/test_generate_files.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files'
context = {'cookiecutter': {'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_linux0')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_with_jinja2_environment

test_generate_files.py::test_generate_files_with_jinja2_environment
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_jinja0')

    def test_generate_files_with_jinja2_environment(tmp_path):
        """Extend StrictEnvironment with _jinja2_env_vars cookiecutter template option."""
>       generate.generate_files(
            context={
                'cookiecutter': {
                    'food': 'pizzä',
                    '_jinja2_env_vars': {'lstrip_blocks': True, 'trim_blocks': True},
                }
            },
            repo_dir='tests/test-generate-files',
            output_dir=tmp_path,
        )

tests/test_generate_files.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files'
context = {'cookiecutter': {'_jinja2_env_vars': {'lstrip_blocks': True, 'trim_blocks': True}, 'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_jinja0')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_with_trailing_newline_forced_to_linux_by_context

test_generate_files.py::test_generate_files_with_trailing_newline_forced_to_linux_by_context
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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,
        )

tests/test_generate_files.py:86: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files'
context = {'cookiecutter': {'_new_lines': '\r\n', 'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_trail0')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_with_windows_newline

test_generate_files.py::test_generate_files_with_windows_newline
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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,
        )

tests/test_generate_files.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files'
context = {'cookiecutter': {'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_windo0')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_with_windows_newline_forced_to_linux_by_context

test_generate_files.py::test_generate_files_with_windows_newline_forced_to_linux_by_context
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_windo1')

    def test_generate_files_with_windows_newline_forced_to_linux_by_context(tmp_path):
        """Verify windows line end changed to linux during files generation."""
>       generate.generate_files(
            context={'cookiecutter': {'food': 'pizzä', '_new_lines': '\n'}},
            repo_dir='tests/test-generate-files',
            output_dir=tmp_path,
        )

tests/test_generate_files.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files'
context = {'cookiecutter': {'_new_lines': '\n', 'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_windo1')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_binaries

test_generate_files.py::test_generate_files_binaries
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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,
        )

tests/test_generate_files.py:142: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-binaries'
context = {'cookiecutter': {'binary_test': 'binary_files'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_binaries0')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_absolute_path

test_generate_files.py::test_generate_files_absolute_path
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_absolute_p0')

    def test_generate_files_absolute_path(tmp_path):
        """Verify usage of absolute path does not change files generation behaviour."""
>       generate.generate_files(
            context={'cookiecutter': {'food': 'pizzä'}},
            repo_dir=Path('tests/test-generate-files').absolute(),
            output_dir=tmp_path,
        )

tests/test_generate_files.py:163: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = PosixPath('/testbed/tests/test-generate-files')
context = {'cookiecutter': {'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_absolute_p0')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_output_dir

test_generate_files.py::test_generate_files_output_dir
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_output_dir0')

    def test_generate_files_output_dir(tmp_path):
        """Verify `output_dir` option for `generate_files` changing location correctly."""
        output_dir = Path(tmp_path, 'custom_output_dir')
        output_dir.mkdir()

>       project_dir = generate.generate_files(
            context={'cookiecutter': {'food': 'pizzä'}},
            repo_dir=Path('tests/test-generate-files').absolute(),
            output_dir=output_dir,
        )

tests/test_generate_files.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = PosixPath('/testbed/tests/test-generate-files')
context = {'cookiecutter': {'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_output_dir0/custom_output_dir')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_permissions

test_generate_files.py::test_generate_files_permissions
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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,
        )

tests/test_generate_files.py:193: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files-permissions'
context = {'cookiecutter': {'permissions': 'permissions'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_permission0')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_with_overwrite_if_exists_with_skip_if_file_exists

test_generate_files.py::test_generate_files_with_overwrite_if_exists_with_skip_if_file_exists
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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,
        )

tests/test_generate_files.py:240: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files'
context = {'cookiecutter': {'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_overw0')
overwrite_if_exists = True, skip_if_file_exists = True, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_with_skip_if_file_exists

test_generate_files.py::test_generate_files_with_skip_if_file_exists
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_skip_0')

    def test_generate_files_with_skip_if_file_exists(tmp_path):
        """Verify existed files not removed if error raised with `skip_if_file_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)
        Path(simple_file).write_text('temp')

        with pytest.raises(exceptions.OutputDirExistsException):
>           generate.generate_files(
                context={'cookiecutter': {'food': 'pizzä'}},
                repo_dir='tests/test-generate-files',
                skip_if_file_exists=True,
                output_dir=tmp_path,
            )

tests/test_generate_files.py:266: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files'
context = {'cookiecutter': {'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_skip_0')
overwrite_if_exists = False, skip_if_file_exists = True, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_generate_files_with_overwrite_if_exists

test_generate_files.py::test_generate_files_with_overwrite_if_exists
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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,
        )

tests/test_generate_files.py:289: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-generate-files'
context = {'cookiecutter': {'food': 'pizzä'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_generate_files_with_overw1')
overwrite_if_exists = True, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_raise_undefined_variable_file_name

test_generate_files.py::test_raise_undefined_variable_file_name
output_dir = '/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/undefined-variable/file-name/'
context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}
output_dir = '/tmp/pytest-of-root/pytest-0/test_raise_undefined_variable_0/output'
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_raise_undefined_variable_file_name_existing_project

test_generate_files.py::test_raise_undefined_variable_file_name_existing_project
output_dir = '/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/undefined-variable/file-name/'
context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}
output_dir = '/tmp/pytest-of-root/pytest-0/test_raise_undefined_variable_1/output'
overwrite_if_exists = True, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_raise_undefined_variable_file_content

test_generate_files.py::test_raise_undefined_variable_file_content
output_dir = '/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/undefined-variable/file-content/'
context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}
output_dir = '/tmp/pytest-of-root/pytest-0/test_raise_undefined_variable_2/output'
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_raise_undefined_variable_dir_name

test_generate_files.py::test_raise_undefined_variable_dir_name
output_dir = '/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/undefined-variable/dir-name/'
context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}
output_dir = '/tmp/pytest-of-root/pytest-0/test_raise_undefined_variable_3/output'
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_keep_project_dir_on_failure

test_generate_files.py::test_keep_project_dir_on_failure
output_dir = '/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/undefined-variable/dir-name/'
context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}
output_dir = '/tmp/pytest-of-root/pytest-0/test_keep_project_dir_on_failu0/output'
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = True

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_raise_undefined_variable_dir_name_existing_project

test_generate_files.py::test_raise_undefined_variable_dir_name_existing_project
output_dir = '/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/undefined-variable/dir-name/'
context = {'cookiecutter': {'github_username': 'hackebrot', 'project_slug': 'testproject'}}
output_dir = '/tmp/pytest-of-root/pytest-0/test_raise_undefined_variable_4/output'
overwrite_if_exists = True, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_files.py::test_raise_undefined_variable_project_dir

test_generate_files.py::test_raise_undefined_variable_project_dir
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/undefined-variable/dir-name/', context = {}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_raise_undefined_variable_5')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_hooks.py::test_ignore_hooks_dirs

test_generate_hooks.py::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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-pyhooks/'
context = {'cookiecutter': {'pyhooks': 'pyhooks'}}
output_dir = 'tests/test-pyhooks/', overwrite_if_exists = False
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_hooks.py::test_run_python_hooks

test_generate_hooks.py::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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-pyhooks/'
context = {'cookiecutter': {'pyhooks': 'pyhooks'}}
output_dir = 'tests/test-pyhooks/', overwrite_if_exists = False
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_hooks.py::test_run_python_hooks_cwd

test_generate_hooks.py::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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-pyhooks/'
context = {'cookiecutter': {'pyhooks': 'pyhooks'}}, output_dir = '.'
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_hooks.py::test_empty_hooks

test_generate_hooks.py::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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-shellhooks-empty/'
context = {'cookiecutter': {'shellhooks': 'shellhooks'}}, output_dir = '.'
overwrite_if_exists = True, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_hooks.py::test_oserror_hooks

test_generate_hooks.py::test_oserror_hooks
mocker = 

    @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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-shellhooks-empty/'
context = {'cookiecutter': {'shellhooks': 'shellhooks'}}, output_dir = '.'
overwrite_if_exists = True, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_hooks.py::test_run_failing_hook_removes_output_directory

test_generate_hooks.py::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)
E       FileExistsError: [Errno 17] File exists: '/testbed/tests/test-hooks'

tests/test_generate_hooks.py:122: FileExistsError

test_generate_hooks.py::test_run_failing_hook_preserves_existing_output_directory

test_generate_hooks.py::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)
E       FileExistsError: [Errno 17] File exists: '/testbed/tests/test-hooks'

tests/test_generate_hooks.py:151: FileExistsError

test_generate_hooks.py::test_run_shell_hooks

test_generate_hooks.py::test_run_shell_hooks
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_run_shell_hooks0')

    @pytest.mark.skipif(sys.platform.startswith('win'), reason="Linux only test")
    @pytest.mark.usefixtures('clean_system', 'remove_additional_folders')
    def test_run_shell_hooks(tmp_path):
        """Verify pre and post generate project shell hooks executed.

        This test for .sh files.
        """
>       generate.generate_files(
            context={'cookiecutter': {'shellhooks': 'shellhooks'}},
            repo_dir='tests/test-shellhooks/',
            output_dir=tmp_path.joinpath('test-shellhooks'),
        )

tests/test_generate_hooks.py:180: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-shellhooks/'
context = {'cookiecutter': {'shellhooks': 'shellhooks'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_run_shell_hooks0/test-shellhooks')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_hooks.py::test_ignore_shell_hooks

test_generate_hooks.py::test_ignore_shell_hooks
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_ignore_shell_hooks0')

    @pytest.mark.usefixtures("clean_system", "remove_additional_folders")
    def test_ignore_shell_hooks(tmp_path):
        """Verify *.txt files not created, when accept_hooks=False."""
>       generate.generate_files(
            context={"cookiecutter": {"shellhooks": "shellhooks"}},
            repo_dir="tests/test-shellhooks/",
            output_dir=tmp_path.joinpath('test-shellhooks'),
            accept_hooks=False,
        )

tests/test_generate_hooks.py:220: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-shellhooks/'
context = {'cookiecutter': {'shellhooks': 'shellhooks'}}
output_dir = PosixPath('/tmp/pytest-of-root/pytest-0/test_ignore_shell_hooks0/test-shellhooks')
overwrite_if_exists = False, skip_if_file_exists = False, accept_hooks = False
keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_generate_hooks.py::test_deprecate_run_hook_from_repo_dir

test_generate_hooks.py::test_deprecate_run_hook_from_repo_dir
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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():
>           generate._run_hook_from_repo_dir(
                repo_dir=repo_dir,
                hook_name="pre_gen_project",
                project_dir=project_dir,
                context={},
                delete_project_on_failure=False,
            )

tests/test_generate_hooks.py:241: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/generate.py:179: in _run_hook_from_repo_dir
    with work_in(repo_dir):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
>           return next(self.gen)
E           TypeError: 'NoneType' object is not an iterator

/usr/lib/python3.10/contextlib.py:135: TypeError

During handling of the above exception, another exception occurred:

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/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 (, , ) were emitted.
E        Emitted warnings: [].

tests/test_generate_hooks.py:240: Failed

test_get_config.py::test_merge_configs

test_get_config.py::test_merge_configs
def test_merge_configs():
        """Verify default and user config merged in expected way."""
        default = {
            'cookiecutters_dir': '/home/example/some-path-to-templates',
            'replay_dir': '/home/example/some-path-to-replay-files',
            'default_context': {},
            'abbreviations': {
                'gh': 'https://github.com/{0}.git',
                'gl': 'https://gitlab.com/{0}.git',
                'bb': 'https://bitbucket.org/{0}',
            },
        }

        user_config = {
            'default_context': {
                'full_name': 'Raphael Pierzina',
                'github_username': 'hackebrot',
            },
            'abbreviations': {
                'gl': 'https://gitlab.com/hackebrot/{0}.git',
                'pytest-plugin': 'https://github.com/pytest-dev/pytest-plugin.git',
            },
        }

        expected_config = {
            'cookiecutters_dir': '/home/example/some-path-to-templates',
            'replay_dir': '/home/example/some-path-to-replay-files',
            'default_context': {
                'full_name': 'Raphael Pierzina',
                'github_username': 'hackebrot',
            },
            'abbreviations': {
                'gh': 'https://github.com/{0}.git',
                'gl': 'https://gitlab.com/hackebrot/{0}.git',
                'bb': 'https://bitbucket.org/{0}',
                'pytest-plugin': 'https://github.com/pytest-dev/pytest-plugin.git',
            },
        }

>       assert config.merge_configs(default, user_config) == expected_config
E       AssertionError: assert None == {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/hackebrot/{0}.git', 'pytest-plugin': 'https://github.com/pytest-dev/pytest-plugin.git'}, 'cookiecutters_dir': '/home/example/some-path-to-templates', 'default_context': {'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot'}, 'replay_dir': '/home/example/some-path-to-replay-files'}
E        +  where None = ({'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git'}, 'cookiecutters_dir': '/home/example/some-path-to-templates', 'default_context': {}, 'replay_dir': '/home/example/some-path-to-replay-files'}, {'abbreviations': {'gl': 'https://gitlab.com/hackebrot/{0}.git', 'pytest-plugin': 'https://github.com/pytest-dev/pytest-plugin.git'}, 'default_context': {'full_name': 'Raphael Pierzina', 'github_username': 'hackebrot'}})
E        +    where  = config.merge_configs

tests/test_get_config.py:51: AssertionError

test_get_config.py::test_get_config

test_get_config.py::test_get_config
def test_get_config():
        """Verify valid config opened and rendered correctly."""
        conf = config.get_config('tests/test-config/valid-config.yaml')
        expected_conf = {
            'cookiecutters_dir': '/home/example/some-path-to-templates',
            'replay_dir': '/home/example/some-path-to-replay-files',
            'default_context': {
                'full_name': 'Firstname Lastname',
                'email': 'firstname.lastname@gmail.com',
                'github_username': 'example',
                'project': {
                    'description': 'description',
                    'tags': [
                        'first',
                        'second',
                        'third',
                    ],
                },
            },
            'abbreviations': {
                'gh': 'https://github.com/{0}.git',
                'gl': 'https://gitlab.com/{0}.git',
                'bb': 'https://bitbucket.org/{0}',
                'helloworld': 'https://github.com/hackebrot/helloworld',
            },
        }
>       assert conf == expected_conf
E       AssertionError: assert None == {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git', 'helloworld': 'https://github.com/hackebrot/helloworld'}, 'cookiecutters_dir': '/home/example/some-path-to-templates', 'default_context': {'email': 'firstname.lastname@gmail.com', 'full_name': 'Firstname Lastname', 'github_username': 'example', 'project': {'description': 'description', 'tags': ['first', 'second', 'third']}}, 'replay_dir': '/home/example/some-path-to-replay-files'}

tests/test_get_config.py:80: AssertionError

test_get_config.py::test_get_config_does_not_exist

test_get_config.py::test_get_config_does_not_exist
def test_get_config_does_not_exist():
        """Check that `exceptions.ConfigDoesNotExistException` is raised when \
        attempting to get a non-existent config file."""
        expected_error_msg = 'Config file tests/not-exist.yaml does not exist.'
>       with pytest.raises(ConfigDoesNotExistException) as exc_info:
E       Failed: DID NOT RAISE 

tests/test_get_config.py:87: Failed

test_get_config.py::test_invalid_config

test_get_config.py::test_invalid_config
def test_invalid_config():
        """An invalid config file should raise an `InvalidConfiguration` \
        exception."""
        expected_error_msg = (
            'Unable to parse YAML file tests/test-config/invalid-config.yaml.'
        )
        with pytest.raises(InvalidConfiguration) as exc_info:
            config.get_config('tests/test-config/invalid-config.yaml')
>           assert expected_error_msg in str(exc_info.value)

tests/test_get_config.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 

    @property
    def value(self) -> E:
        """The exception value."""
        assert (
>           self._excinfo is not None
        ), ".value can only be used after the context manager exits"
E       AssertionError: .value can only be used after the context manager exits

.venv/lib/python3.10/site-packages/_pytest/_code/code.py:548: AssertionError

test_get_config.py::test_get_config_with_defaults

test_get_config.py::test_get_config_with_defaults
def test_get_config_with_defaults():
        """A config file that overrides 1 of 3 defaults."""
        conf = config.get_config('tests/test-config/valid-partial-config.yaml')
        default_cookiecutters_dir = Path('~/.cookiecutters').expanduser()
        default_replay_dir = Path('~/.cookiecutter_replay').expanduser()
        expected_conf = {
            'cookiecutters_dir': str(default_cookiecutters_dir),
            'replay_dir': str(default_replay_dir),
            'default_context': {
                'full_name': 'Firstname Lastname',
                'email': 'firstname.lastname@gmail.com',
                'github_username': 'example',
            },
            'abbreviations': {
                'gh': 'https://github.com/{0}.git',
                'gl': 'https://gitlab.com/{0}.git',
                'bb': 'https://bitbucket.org/{0}',
            },
        }
>       assert conf == expected_conf
E       AssertionError: assert None == {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git'}, 'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/test_get_config_with_defaults0/home/.cookiecutters', 'default_context': {'email': 'firstname.lastname@gmail.com', 'full_name': 'Firstname Lastname', 'github_username': 'example'}, 'replay_dir': '/tmp/pytest-of-root/pytest-0/test_get_config_with_defaults0/home/.cookiecutter_replay'}

tests/test_get_config.py:123: AssertionError

test_get_config.py::test_get_config_empty_config_file

test_get_config.py::test_get_config_empty_config_file
def test_get_config_empty_config_file():
        """An empty config file results in the default config."""
        conf = config.get_config('tests/test-config/empty-config.yaml')
>       assert conf == config.DEFAULT_CONFIG
E       AssertionError: assert None == {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git'}, 'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/test_get_config_empty_config_f0/home/.cookiecutters', 'default_context': OrderedDict(), 'replay_dir': '/tmp/pytest-of-root/pytest-0/test_get_config_empty_config_f0/home/.cookiecutter_replay'}
E        +  where {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git'}, 'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/test_get_config_empty_config_f0/home/.cookiecutters', 'default_context': OrderedDict(), 'replay_dir': '/tmp/pytest-of-root/pytest-0/test_get_config_empty_config_f0/home/.cookiecutter_replay'} = config.DEFAULT_CONFIG

tests/test_get_config.py:129: AssertionError

test_get_config.py::test_get_config_invalid_file_with_array_as_top_level_element

test_get_config.py::test_get_config_invalid_file_with_array_as_top_level_element
def test_get_config_invalid_file_with_array_as_top_level_element():
        """An exception should be raised if top-level element is array."""
        expected_error_msg = (
            'Top-level element of YAML file '
            'tests/test-config/invalid-config-w-array.yaml should be an object.'
        )
>       with pytest.raises(InvalidConfiguration) as exc_info:
E       Failed: DID NOT RAISE 

tests/test_get_config.py:138: Failed

test_get_config.py::test_get_config_invalid_file_with_multiple_docs

test_get_config.py::test_get_config_invalid_file_with_multiple_docs
def test_get_config_invalid_file_with_multiple_docs():
        """An exception should be raised if config file contains multiple docs."""
        expected_error_msg = (
            'Unable to parse YAML file '
            'tests/test-config/invalid-config-w-multiple-docs.yaml.'
        )
>       with pytest.raises(InvalidConfiguration) as exc_info:
E       Failed: DID NOT RAISE 

tests/test_get_config.py:149: Failed

test_get_user_config.py::test_get_user_config_valid

test_get_user_config.py::test_get_user_config_valid
user_config_path = '/root/.cookiecutterrc'
custom_config = {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git', 'helloworld': 'https://github.com/hackebrot/helloworld'}, 'cookiecutters_dir': '/home/example/some-path-to-templates', 'default_context': {'email': 'firstname.lastname@gmail.com', 'full_name': 'Firstname Lastname', 'github_username': 'example', 'project': {'description': 'description', 'tags': ['first', 'second', 'third']}}, 'replay_dir': '/home/example/some-path-to-replay-files'}

    @pytest.mark.usefixtures('back_up_rc')
    def test_get_user_config_valid(user_config_path, custom_config):
        """Validate user config correctly parsed if exist and correctly formatted."""
        shutil.copy('tests/test-config/valid-config.yaml', user_config_path)
        conf = config.get_user_config()

>       assert conf == custom_config
E       AssertionError: assert None == {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git', 'helloworld': 'https://github.com/hackebrot/helloworld'}, 'cookiecutters_dir': '/home/example/some-path-to-templates', 'default_context': {'email': 'firstname.lastname@gmail.com', 'full_name': 'Firstname Lastname', 'github_username': 'example', 'project': {'description': 'description', 'tags': ['first', 'second', 'third']}}, 'replay_dir': '/home/example/some-path-to-replay-files'}

tests/test_get_user_config.py:76: AssertionError

test_get_user_config.py::test_get_user_config_invalid

test_get_user_config.py::test_get_user_config_invalid
user_config_path = '/root/.cookiecutterrc'

    @pytest.mark.usefixtures('back_up_rc')
    def test_get_user_config_invalid(user_config_path):
        """Validate `InvalidConfiguration` raised when provided user config malformed."""
        shutil.copy('tests/test-config/invalid-config.yaml', user_config_path)
>       with pytest.raises(InvalidConfiguration):
E       Failed: DID NOT RAISE 

tests/test_get_user_config.py:83: Failed

test_get_user_config.py::test_get_user_config_nonexistent

test_get_user_config.py::test_get_user_config_nonexistent
@pytest.mark.usefixtures('back_up_rc')
    def test_get_user_config_nonexistent():
        """Validate default app config returned, if user does not have own config."""
>       assert config.get_user_config() == config.DEFAULT_CONFIG
E       AssertionError: assert None == {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git'}, 'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/test_get_user_config_nonexiste0/home/.cookiecutters', 'default_context': OrderedDict(), 'replay_dir': '/tmp/pytest-of-root/pytest-0/test_get_user_config_nonexiste0/home/.cookiecutter_replay'}
E        +  where None = ()
E        +    where  = config.get_user_config
E        +  and   {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git'}, 'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/test_get_user_config_nonexiste0/home/.cookiecutters', 'default_context': OrderedDict(), 'replay_dir': '/tmp/pytest-of-root/pytest-0/test_get_user_config_nonexiste0/home/.cookiecutter_replay'} = config.DEFAULT_CONFIG

tests/test_get_user_config.py:90: AssertionError

test_get_user_config.py::test_specify_config_path

test_get_user_config.py::test_specify_config_path
self = 
args = ('tests/test-config/valid-config.yaml',), kwargs = {}
msg = "Expected 'get_config' 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 'get_config' 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 = 
custom_config_path = 'tests/test-config/valid-config.yaml'
custom_config = {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git', 'helloworld': 'https://github.com/hackebrot/helloworld'}, 'cookiecutters_dir': '/home/example/some-path-to-templates', 'default_context': {'email': 'firstname.lastname@gmail.com', 'full_name': 'Firstname Lastname', 'github_username': 'example', 'project': {'description': 'description', 'tags': ['first', 'second', 'third']}}, 'replay_dir': '/home/example/some-path-to-replay-files'}

    def test_specify_config_path(mocker, custom_config_path, custom_config):
        """Validate provided custom config path should be respected and parsed."""
        spy_get_config = mocker.spy(config, 'get_config')

        user_config = config.get_user_config(custom_config_path)
>       spy_get_config.assert_called_once_with(custom_config_path)

tests/test_get_user_config.py:104: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = ('tests/test-config/valid-config.yaml',), kwargs = {}

    def assert_called_once_with(*args, **kwargs):
>       return mock.assert_called_once_with(*args, **kwargs)
E       AssertionError: Expected 'get_config' to be called once. Called 0 times.

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

test_get_user_config.py::test_default_config_from_env_variable

test_get_user_config.py::test_default_config_from_env_variable
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6f9a1390>
custom_config_path = 'tests/test-config/valid-config.yaml'
custom_config = {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git', 'helloworld': 'https://github.com/hackebrot/helloworld'}, 'cookiecutters_dir': '/home/example/some-path-to-templates', 'default_context': {'email': 'firstname.lastname@gmail.com', 'full_name': 'Firstname Lastname', 'github_username': 'example', 'project': {'description': 'description', 'tags': ['first', 'second', 'third']}}, 'replay_dir': '/home/example/some-path-to-replay-files'}

    def test_default_config_from_env_variable(
        monkeypatch, custom_config_path, custom_config
    ):
        """Validate app configuration. User config path should be parsed from sys env."""
        monkeypatch.setenv('COOKIECUTTER_CONFIG', custom_config_path)

        user_config = config.get_user_config()
>       assert user_config == custom_config
E       AssertionError: assert None == {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git', 'helloworld': 'https://github.com/hackebrot/helloworld'}, 'cookiecutters_dir': '/home/example/some-path-to-templates', 'default_context': {'email': 'firstname.lastname@gmail.com', 'full_name': 'Firstname Lastname', 'github_username': 'example', 'project': {'description': 'description', 'tags': ['first', 'second', 'third']}}, 'replay_dir': '/home/example/some-path-to-replay-files'}

tests/test_get_user_config.py:121: AssertionError

test_get_user_config.py::test_force_default_config

test_get_user_config.py::test_force_default_config
mocker = 
custom_config_path = 'tests/test-config/valid-config.yaml'

    def test_force_default_config(mocker, custom_config_path):
        """Validate `default_config=True` should ignore provided custom user config."""
        spy_get_config = mocker.spy(config, 'get_config')

        user_config = config.get_user_config(custom_config_path, default_config=True)

>       assert user_config == config.DEFAULT_CONFIG
E       AssertionError: assert None == {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git'}, 'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/test_force_default_config0/home/.cookiecutters', 'default_context': OrderedDict(), 'replay_dir': '/tmp/pytest-of-root/pytest-0/test_force_default_config0/home/.cookiecutter_replay'}
E        +  where {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git'}, 'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/test_force_default_config0/home/.cookiecutters', 'default_context': OrderedDict(), 'replay_dir': '/tmp/pytest-of-root/pytest-0/test_force_default_config0/home/.cookiecutter_replay'} = config.DEFAULT_CONFIG

tests/test_get_user_config.py:130: AssertionError

test_get_user_config.py::test_expand_user_for_directories_in_config

test_get_user_config.py::test_expand_user_for_directories_in_config
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6f44ba00>

    def test_expand_user_for_directories_in_config(monkeypatch):
        """Validate user pointers expanded in user configs."""

        def _expanduser(path):
            return path.replace('~', 'Users/bob')

        monkeypatch.setattr('os.path.expanduser', _expanduser)

        config_file = 'tests/test-config/config-expand-user.yaml'

        user_config = config.get_user_config(config_file)
>       assert user_config['replay_dir'] == 'Users/bob/replay-files'
E       TypeError: 'NoneType' object is not subscriptable

tests/test_get_user_config.py:145: TypeError

test_get_user_config.py::test_expand_vars_for_directories_in_config

test_get_user_config.py::test_expand_vars_for_directories_in_config
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6fe680a0>

    def test_expand_vars_for_directories_in_config(monkeypatch):
        """Validate environment variables expanded in user configs."""
        monkeypatch.setenv('COOKIES', 'Users/bob/cookies')

        config_file = 'tests/test-config/config-expand-vars.yaml'

        user_config = config.get_user_config(config_file)
>       assert user_config['replay_dir'] == 'Users/bob/cookies/replay-files'
E       TypeError: 'NoneType' object is not subscriptable

tests/test_get_user_config.py:156: TypeError

test_get_user_config.py::test_specify_config_values

test_get_user_config.py::test_specify_config_values
def test_specify_config_values():
        """Validate provided custom config values should be respected."""
        replay_dir = 'Users/bob/cookies/custom-replay-dir'
        custom_config_updated = {**config.DEFAULT_CONFIG, 'replay_dir': replay_dir}

        user_config = config.get_user_config(default_config={'replay_dir': replay_dir})

>       assert user_config == custom_config_updated
E       AssertionError: assert None == {'abbreviations': {'bb': 'https://bitbucket.org/{0}', 'gh': 'https://github.com/{0}.git', 'gl': 'https://gitlab.com/{0}.git'}, 'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/test_specify_config_values0/home/.cookiecutters', 'default_context': OrderedDict(), 'replay_dir': 'Users/bob/cookies/custom-replay-dir'}

tests/test_get_user_config.py:167: AssertionError

test_hooks.py::TestFindHooks::test_find_hook

test_hooks.py::TestFindHooks::test_find_hook
self = 
method = >

    def setup_method(self, method):
        """Find hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path)

tests/test_hooks.py:82: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'tests/test-hooks', multiple_hooks = False

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: 'tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestFindHooks::test_no_hooks

test_hooks.py::TestFindHooks::test_no_hooks
self = 
method = >

    def setup_method(self, method):
        """Find hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path)

tests/test_hooks.py:82: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'tests/test-hooks', multiple_hooks = False

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: 'tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestFindHooks::test_unknown_hooks_dir

test_hooks.py::TestFindHooks::test_unknown_hooks_dir
self = 
method = >

    def setup_method(self, method):
        """Find hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path)

tests/test_hooks.py:82: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'tests/test-hooks', multiple_hooks = False

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: 'tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestFindHooks::test_hook_not_found

test_hooks.py::TestFindHooks::test_hook_not_found
self = 
method = >

    def setup_method(self, method):
        """Find hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path)

tests/test_hooks.py:82: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = 'tests/test-hooks', multiple_hooks = False

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: 'tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestExternalHooks::test_run_script

test_hooks.py::TestExternalHooks::test_run_script
self = 
method = >

    def setup_method(self, method):
        """External hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path, multiple_hooks=True)

tests/test_hooks.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = '/testbed/tests/test-hooks', multiple_hooks = True

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: '/testbed/tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestExternalHooks::test_run_failing_script

test_hooks.py::TestExternalHooks::test_run_failing_script
self = 
method = >

    def setup_method(self, method):
        """External hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path, multiple_hooks=True)

tests/test_hooks.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = '/testbed/tests/test-hooks', multiple_hooks = True

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: '/testbed/tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestExternalHooks::test_run_failing_script_enoexec

test_hooks.py::TestExternalHooks::test_run_failing_script_enoexec
self = 
method = >

    def setup_method(self, method):
        """External hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path, multiple_hooks=True)

tests/test_hooks.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = '/testbed/tests/test-hooks', multiple_hooks = True

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: '/testbed/tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestExternalHooks::test_run_script_cwd

test_hooks.py::TestExternalHooks::test_run_script_cwd
self = 
method = >

    def setup_method(self, method):
        """External hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path, multiple_hooks=True)

tests/test_hooks.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = '/testbed/tests/test-hooks', multiple_hooks = True

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: '/testbed/tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestExternalHooks::test_run_script_with_context

test_hooks.py::TestExternalHooks::test_run_script_with_context
self = 
method = >

    def setup_method(self, method):
        """External hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path, multiple_hooks=True)

tests/test_hooks.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = '/testbed/tests/test-hooks', multiple_hooks = True

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: '/testbed/tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestExternalHooks::test_run_hook

test_hooks.py::TestExternalHooks::test_run_hook
self = 
method = >

    def setup_method(self, method):
        """External hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path, multiple_hooks=True)

tests/test_hooks.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = '/testbed/tests/test-hooks', multiple_hooks = True

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: '/testbed/tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::TestExternalHooks::test_run_failing_hook

test_hooks.py::TestExternalHooks::test_run_failing_hook
self = 
method = >

    def setup_method(self, method):
        """External hooks related tests setup fixture."""
>       self.post_hook = make_test_repo(self.repo_path, multiple_hooks=True)

tests/test_hooks.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

name = '/testbed/tests/test-hooks', multiple_hooks = True

    def make_test_repo(name, multiple_hooks=False):
        """Create test repository for test setup methods."""
        hook_dir = os.path.join(name, 'hooks')
        template = os.path.join(name, 'input{{hooks}}')
>       os.mkdir(name)
E       FileExistsError: [Errno 17] File exists: '/testbed/tests/test-hooks'

tests/test_hooks.py:19: FileExistsError

test_hooks.py::test_ignore_hook_backup_files

test_hooks.py::test_ignore_hook_backup_files
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6fa67370>
dir_with_hooks = '/tmp/pytest-of-root/pytest-0/test_ignore_hook_backup_files0'

    def test_ignore_hook_backup_files(monkeypatch, dir_with_hooks):
        """Test `find_hook` correctly use `valid_hook` verification function."""
        # Change the current working directory that contains `hooks/`
        monkeypatch.chdir(dir_with_hooks)
>       assert hooks.find_hook('pre_gen_project') is None
E       AssertionError: assert '/tmp/pytest-of-root/pytest-0/test_ignore_hook_backup_files0/hooks/pre_gen_project.py~' is None
E        +  where '/tmp/pytest-of-root/pytest-0/test_ignore_hook_backup_files0/hooks/pre_gen_project.py~' = ('pre_gen_project')
E        +    where  = hooks.find_hook

/testbed/tests/test_hooks.py:274: AssertionError

test_log.py::test_info_stdout_logging

test_log.py::test_info_stdout_logging
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f6a6fb5e320>
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_log.py::test_debug_stdout_logging

test_log.py::test_debug_stdout_logging
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f6a6fc01810>
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_log.py::test_debug_file_logging

test_log.py::test_debug_file_logging
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f6a6fb5efb0>
info_logger_with_file = None
debug_file = PosixPath('/tmp/pytest-of-root/pytest-0/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_main.py::test_original_cookiecutter_options_preserved_in__cookiecutter

test_main.py::test_original_cookiecutter_options_preserved_in__cookiecutter
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6fc03b20>
mocker = 
user_config_file = '/tmp/pytest-of-root/pytest-0/user_dir0/config'

    def test_original_cookiecutter_options_preserved_in__cookiecutter(
        monkeypatch,
        mocker,
        user_config_file,
    ):
        """Preserve original context options.

        Tests you can access the original context options via
        `context['_cookiecutter']`.
        """
        monkeypatch.chdir('tests/fake-repo-tmpl-_cookiecutter')
        mock_generate_files = mocker.patch('cookiecutter.main.generate_files')
>       cookiecutter(
            '.',
            no_input=True,
            replay=False,
            config_file=user_config_file,
        )

/testbed/tests/test_main.py:18: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = '.', checkout = None, no_input = True, extra_context = None
replay = False, overwrite_if_exists = False, output_dir = '.'
config_file = '/tmp/pytest-of-root/pytest-0/user_dir0/config'
default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

/testbed/cookiecutter/main.py:65: TypeError

test_main.py::test_replay_dump_template_name

test_main.py::test_replay_dump_template_name
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6f6a5ba0>
mocker = 
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutter_replay'}
user_config_file = '/tmp/pytest-of-root/pytest-0/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,
        )

/testbed/tests/test_main.py:51: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = '.', checkout = None, no_input = True, extra_context = None
replay = False, overwrite_if_exists = False, output_dir = '.'
config_file = '/tmp/pytest-of-root/pytest-0/user_dir0/config'
default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

/testbed/cookiecutter/main.py:65: TypeError

test_main.py::test_replay_load_template_name

test_main.py::test_replay_load_template_name
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6fb3ad10>
mocker = 
user_config_data = {'cookiecutters_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutters', 'replay_dir': '/tmp/pytest-of-root/pytest-0/user_dir0/cookiecutter_replay'}
user_config_file = '/tmp/pytest-of-root/pytest-0/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,
        )

/testbed/tests/test_main.py:84: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = '.', checkout = None, no_input = False, extra_context = None
replay = True, overwrite_if_exists = False, output_dir = '.'
config_file = '/tmp/pytest-of-root/pytest-0/user_dir0/config'
default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

/testbed/cookiecutter/main.py:65: TypeError

test_main.py::test_custom_replay_file

test_main.py::test_custom_replay_file
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6f9a1bd0>
mocker = 
user_config_file = '/tmp/pytest-of-root/pytest-0/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,
        )

/testbed/tests/test_main.py:107: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

template = '.', checkout = None, no_input = False, extra_context = None
replay = './custom-replay-file', overwrite_if_exists = False, output_dir = '.'
config_file = '/tmp/pytest-of-root/pytest-0/user_dir0/config'
default_config = False, password = None, directory = None
skip_if_file_exists = False, accept_hooks = True
keep_project_on_failure = False

    def cookiecutter(template, checkout=None, no_input=False, extra_context=None, replay=None, overwrite_if_exists=False, output_dir='.', config_file=None, default_config=False, password=None, directory=None, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """
        Run Cookiecutter just as if using it from the command line.

        :param template: A directory containing a project template directory,
            or a URL to a git repository.
        :param checkout: The branch, tag or commit ID to checkout after clone.
        :param no_input: Do not prompt for user input.
            Use default values for template parameters taken from `cookiecutter.json`, user
            config and `extra_dict`. Force a refresh of cached resources.
        :param extra_context: A dictionary of context that overrides default
            and user configuration.
        :param replay: Do not prompt for input, instead read from saved json. If
            ``True`` read from the ``replay_dir``.
            if it exists
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param output_dir: Where to output the generated project dir into.
        :param config_file: User configuration file path.
        :param default_config: Use default values rather than a config file.
        :param password: The password to use when extracting the repository.
        :param directory: Relative path to a cookiecutter template in a repository.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist.
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        :raises: `InvalidModeException` if both `no_input` and `replay` are True.
        """
        if replay and no_input:
            raise InvalidModeException(
                'You cannot use both replay and no_input flags at the same time.'
            )

        # Get user config from ~/.cookiecutterrc or equivalent
        config_dict = get_user_config(
            config_file=config_file,
            default_config=default_config,
        )

        # Get the repo dir, where the cookiecutter template source is stored
        repo_dir, cleanup = determine_repo_dir(
            template=template,
>           abbreviations=config_dict['abbreviations'],
            clone_to_dir=config_dict['cookiecutters_dir'],
            checkout=checkout,
            no_input=no_input,
            password=password,
            directory=directory
        )
E       TypeError: 'NoneType' object is not subscriptable

/testbed/cookiecutter/main.py:65: TypeError

test_output_folder.py::test_output_folder

test_output_folder.py::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')

tests/test_output_folder.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-output-folder'
context = {'cookiecutter': OrderedDict([('full_name', 'Audrey Greenfeld'), ('year', '2014'), ('color', 'green'), ('letter', 'D'), ('folder_name', 'im_a.dir'), ('filename', 'im_a.file'), ('test_name', 'output_folder')])}
output_dir = '.', overwrite_if_exists = False, skip_if_file_exists = False
accept_hooks = True, keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_output_folder.py::test_exception_when_output_folder_exists

test_output_folder.py::test_exception_when_output_folder_exists
@pytest.mark.usefixtures('clean_system', 'remove_output_folder')
    def test_exception_when_output_folder_exists():
        """Tests should raise error as output folder created before `generate_files`."""
        context = generate.generate_context(
            context_file='tests/test-output-folder/cookiecutter.json'
        )
        output_folder = context['cookiecutter']['test_name']

        if not os.path.exists(output_folder):
            os.makedirs(output_folder)
        with pytest.raises(exceptions.OutputDirExistsException):
>           generate.generate_files(context=context, repo_dir='tests/test-output-folder')

tests/test_output_folder.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-output-folder'
context = {'cookiecutter': OrderedDict([('full_name', 'Audrey Greenfeld'), ('year', '2014'), ('color', 'green'), ('letter', 'D'), ('folder_name', 'im_a.dir'), ('filename', 'im_a.file'), ('test_name', 'output_folder')])}
output_dir = '.', overwrite_if_exists = False, skip_if_file_exists = False
accept_hooks = True, keep_project_on_failure = False

    def generate_files(repo_dir, context=None, output_dir='.', overwrite_if_exists=False, skip_if_file_exists=False, accept_hooks=True, keep_project_on_failure=False):
        """Render the templates and saves them to files.

        :param repo_dir: Project template input directory.
        :param context: Dict for populating the template's variables.
        :param output_dir: Where to output the generated project dir into.
        :param overwrite_if_exists: Overwrite the contents of the output directory
            if it exists.
        :param skip_if_file_exists: Skip the files in the corresponding directories
            if they already exist
        :param accept_hooks: Accept pre and post hooks if set to `True`.
        :param keep_project_on_failure: If `True` keep generated project directory even when
            generation fails
        """
        context = context or {}
        env = create_env_with_context(context)

>       template_dir = find_template(repo_dir)
E       TypeError: find_template() missing 1 required positional argument: 'env'

cookiecutter/generate.py:213: TypeError

test_pre_prompt_hooks.py::test_run_pre_prompt_python_hook

test_pre_prompt_hooks.py::test_run_pre_prompt_python_hook
remove_tmp_repo_dir = ._func at 0x7f6a6f334310>

    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: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-pyhooks/'

    def run_pre_prompt_hook(repo_dir: 'os.PathLike[str]') -> Path:
        """Run pre_prompt hook from repo directory.

        :param repo_dir: Project template input directory.
        """
        # Create a temporary directory for the pre-prompt hook
>       temp_dir = create_tmp_repo_dir()
E       TypeError: create_tmp_repo_dir() missing 1 required positional argument: 'repo_dir'

cookiecutter/hooks.py:169: TypeError

test_pre_prompt_hooks.py::test_run_pre_prompt_python_hook_fail

test_pre_prompt_hooks.py::test_run_pre_prompt_python_hook_fail
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6a6f9b0ac0>

    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/')

tests/test_pre_prompt_hooks.py:40: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-pyhooks/'

    def run_pre_prompt_hook(repo_dir: 'os.PathLike[str]') -> Path:
        """Run pre_prompt hook from repo directory.

        :param repo_dir: Project template input directory.
        """
        # Create a temporary directory for the pre-prompt hook
>       temp_dir = create_tmp_repo_dir()
E       TypeError: create_tmp_repo_dir() missing 1 required positional argument: 'repo_dir'

cookiecutter/hooks.py:169: TypeError

test_pre_prompt_hooks.py::test_run_pre_prompt_shell_hook

test_pre_prompt_hooks.py::test_run_pre_prompt_shell_hook
remove_tmp_repo_dir = ._func at 0x7f6a6f1aed40>

    @pytest.mark.skipif(WINDOWS, reason='shell script will not run in Windows')
    def test_run_pre_prompt_shell_hook(remove_tmp_repo_dir):
        """Verify pre_prompt.sh runs and creates a copy of cookiecutter.json."""
>       new_repo_dir = hooks.run_pre_prompt_hook(repo_dir='tests/test-pyshellhooks/')

tests/test_pre_prompt_hooks.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

repo_dir = 'tests/test-pyshellhooks/'

    def run_pre_prompt_hook(repo_dir: 'os.PathLike[str]') -> Path:
        """Run pre_prompt hook from repo directory.

        :param repo_dir: Project template input directory.
        """
        # Create a temporary directory for the pre-prompt hook
>       temp_dir = create_tmp_repo_dir()
E       TypeError: create_tmp_repo_dir() missing 1 required positional argument: 'repo_dir'

cookiecutter/hooks.py:169: TypeError

test_prompt.py::TestRenderVariable::test_convert_to_str[1-1]

test_prompt.py::TestRenderVariable::test_convert_to_str[1-1]
self = 
mocker = 
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

test_prompt.py::TestRenderVariable::test_convert_to_str[{{cookiecutter.project}}-foobar]

test_prompt.py::TestRenderVariable::test_convert_to_str[{{cookiecutter.project}}-foobar]
self = 
mocker = 
raw_var = '{{cookiecutter.project}}', rendered_var = 'foobar'

    @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)

tests/test_prompt.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
cookiecutter/prompt.py:162: in render_variable
    rendered = template.render(**cookiecutter_dict)
.venv/lib/python3.10/site-packages/jinja2/environment.py:1304: in render
    self.environment.handle_exception()
.venv/lib/python3.10/site-packages/jinja2/environment.py:939: in handle_exception
    raise rewrite_traceback_stack(source=source)