pytest-cookies
The pytest plugin for your Cookiecutter templates. 🍪
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-cookiesuv
uv add pytest-cookiespoetry
poetry add pytest-cookiesInstalling 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
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-loggingA pytest plugin that configures Python logging…
permissive · top 15,000 on PyPI
cookiecutterCookiecutter is a command-line tool that…
unclear · top 5,000 on PyPI
pytest-xmlA pytest plugin that generates XML output from…
unclear · top 15,000 on PyPI
cruftcruft creates new projects from Cookiecutter…
permissive · top 15,000 on PyPI
pytest-regressionsProvides pytest fixtures for writing regression…
permissive · top 5,000 on PyPI
pytest-subtestsAdds subTest() support to pytest, allowing…
permissive · top 5,000 on PyPI
pytest-datadirA pytest plugin that provides fixtures for…
permissive · top 5,000 on PyPI
pytest-error-for-skipsA pytest plugin that converts skipped tests…
permissive · top 15,000 on PyPI
pytest-freezegunpytest-freezegun provides a pytest plugin that…
permissive · top 5,000 on PyPI
pytest-custom-exit-codeA pytest plugin that lets you customize the…
permissive · top 5,000 on PyPI