def cookiecutter_config(tmpdir_factory) -> str:
    """py.test fixture to generate a tmp config file for cookiecutter.

    :return: Path to cookiecutter config file.
   """
    user_dir = tmpdir_factory.mktemp('user_dir')
    cookiecutters_dir = user_dir.mkdir('cookiecutters')
    replay_dir = user_dir.mkdir('cookiecutter_replay')
    USER_CONFIG = '''cookiecutters_dir: "{cookiecutters_dir}"\nreplay_dir: "{replay_dir}"'''
    config_text = USER_CONFIG.format(
        cookiecutters_dir=cookiecutters_dir,
        replay_dir=replay_dir,
    )
    config_file = user_dir.join('config')

    config_file.write_text(config_text, encoding='utf8')
    return str(config_file)