pytest-generator

Generate pytest unit tests with fixtures, mocks, and parametrization for Python code.

25|2|Updated Oct 26, 2025
One-click install
npx skills add https://github.com/matteocervelli/llms --skill pytest-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-generator
Source: https://github.com/matteocervelli/llms/tree/main/.claude/skills/pytest-generator
Command: npx skills add https://github.com/matteocervelli/llms --skill pytest-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of pytest-based unit tests with fixtures, mocks, and parametrization templates.

Core Features & Use Cases

  • Test File Scaffolding: Create pytest test files with AAA structure.
  • Fixture Library: Include reusable fixtures for common data.
  • Parametrization: Provide example parametrize blocks for coverage.

Quick Start

Scaffold pytest tests for a Python module to bootstrap test development.

Frequently Asked Questions about pytest-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate pytest test files for Python modules?

Generate pytest test files by analyzing your source code and creating scaffolded unit tests with fixtures, mocks, and parametrization. The generator maps source modules to test files following project conventions, producing structured test skeletons ready for your assertions and logic.

Can I use pytest fixtures and mocks in auto-generated tests?

Yes. The generator includes reusable fixture templates and mock patching blocks within test scaffolds, enabling you to test dependencies and edge cases without manual setup boilerplate.

What's the best way to bootstrap test coverage for existing Python code?

Bootstrap test coverage by generating pytest scaffolds for new modules and missing test files. The generator produces AAA-structured test skeletons with parametrize examples to accelerate coverage of public APIs and edge cases.

Do I need to set up test files manually before using pytest scaffolding?

No. The generator creates complete test file structures automatically, including directory mapping and conventional naming aligned with project standards, so you skip manual file and fixture setup.

How does parametrization help validate multiple test cases?

Parametrization templates in generated tests let you run the same test logic across multiple input combinations, reducing code duplication and improving coverage of edge cases and boundary conditions.