skillfed

pytest-cookies

The pytest plugin for your Cookiecutter templates. 🍪

pytest-cookies v0.7.0 93.5K downloads/30d#13,383 on PyPI189
Permissive license MIT Abandoned released

What it is and what it does

pytest-cookies is a pytest plugin that wraps the cookiecutter API into a reusable `cookies` fixture for testing cookiecutter project templates. When you call `cookies.bake()`, it generates a new project from your template using default values from `cookiecutter.json`, optionally overriding them with `extra_context` to test different input scenarios. The fixture automatically cleans up generated projects after tests complete, keeping your test environment tidy.

The plugin depends on pytest and cookiecutter as runtime dependencies. It supports Python 3.7 through 3.11 and is classified as Production/Stable. The package has been in development since 2015 but has entered abandoned maintenance with no releases since 2023-03-22, though the repository has not been archived.

Use it for:

  • Verify that a cookiecutter template generates valid project structures with expected file layouts and naming conventions.
  • Test template rendering by injecting custom context values and asserting the output contains correct variable substitutions.
  • Validate that cookiecutter templates work correctly across different Python versions and operating systems in CI/CD pipelines.
  • Ensure template validation rules and default values produce sensible projects without manual intervention.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A pytest plugin that provides a `cookies` fixture for testing cookiecutter templates by generating projects from them and automatically cleaning up afterward.

Yes, if you maintain a cookiecutter template and need to test it—the plugin is straightforward and has no known vulnerabilities. However, proceed with caution: the package is in abandoned maintenance with no releases since 2023-03-22. If you encounter bugs or compatibility issues with newer pytest or cookiecutter versions, you may need to fork or patch it yourself.

Install

pytest-cookies on PyPI

pip

pip install pytest-cookies

uv

uv add pytest-cookies

poetry

poetry add pytest-cookies

Installing pytest-cookies

Before you install

Low install friction with just two runtime dependencies. However, the package is in abandoned maintenance status with no releases since 2023-03-22, though the repository remains active.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install pytest-cookies

# In your test file:
def test_bake_project(cookies):
    result = cookies.bake(extra_context={"repo_name": "helloworld"})
    assert result.exit_code == 0
    assert result.project_path.is_dir()

Verify before relying

  • Whether the package remains compatible with current versions of pytest and cookiecutter despite no releases since 2023-03-22
  • Whether abandonment status means critical bugs or security issues will not be addressed going forward

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — cookiecutter, pytest
Maintenance abandoned — 1,241 days since the last release
Last repo commit
First released
Downloads 93,479/month — #13,383 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pytest_cookies-0.7.0-py3-none-any.whl

Keywords: cookiecutter, pytest

Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Testing

Tags

pytest cookiecutter template testingtest cookiecutter templatespytest plugin for templatescookiecutter project generation testingtemplate validation pytest
cookiecuttertemplate-testingpytest-plugin

More Testing packages

pluggy

Pluggy provides a plugin system that lets you…

permissive · top 100 on PyPI

pytest

pytest is a testing framework that lets you…

permissive · top 100 on PyPI

virtualenv

virtualenv creates isolated Python environments…

permissive · top 100 on PyPI

coverage

Coverage.py measures which lines of Python code…

permissive · top 1,000 on PyPI

pytest-asyncio

pytest-asyncio is a pytest plugin that enables…

permissive · top 1,000 on PyPI

pytest-json-ctrf

A pytest plugin that generates test reports in…

permissive · top 1,000 on PyPI

pytest-logging

A pytest plugin that configures Python logging…

permissive · top 15,000 on PyPI

cookiecutter

Cookiecutter is a command-line tool that…

unclear · top 5,000 on PyPI

pytest-xml

A pytest plugin that generates XML output from…

unclear · top 15,000 on PyPI

cruft

cruft creates new projects from Cookiecutter…

permissive · top 15,000 on PyPI

pytest-regressions

Provides pytest fixtures for writing regression…

permissive · top 5,000 on PyPI

pytest-subtests

Adds subTest() support to pytest, allowing…

permissive · top 5,000 on PyPI

pytest-datadir

A pytest plugin that provides fixtures for…

permissive · top 5,000 on PyPI

pytest-error-for-skips

A pytest plugin that converts skipped tests…

permissive · top 15,000 on PyPI

pytest-freezegun

pytest-freezegun provides a pytest plugin that…

permissive · top 5,000 on PyPI

pytest-custom-exit-code

A pytest plugin that lets you customize the…

permissive · top 5,000 on PyPI