test-generator

Generates pytest-based unit and integration tests from Python source code with configurable scope.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/sunLeee/optimization --skill test-generator-sunleee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-generator
Source: https://github.com/sunLeee/optimization/tree/main/.claude/skills/process/test-generator
Command: npx skills add https://github.com/sunLeee/optimization --skill test-generator-sunleee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyzes source code to automatically generate pytest-based tests following convention-testing rules (AAA pattern and naming conventions), reducing manual test-writing effort and ensuring consistent test structure.

Core Features & Use Cases

  • Automatic pytest-based test generation: analyze functions and classes to derive unit and integration tests.
  • AAA conformity & naming: enforces Arrange-Act-Assert structure and descriptive test names.
  • Fixtures, parameterization, and templates: creates reusable fixtures, parameterized cases, and ready-to-run templates for new modules.
  • Use case: given a Python module with public APIs, generate a complete test suite that covers typical usage, edge cases, and error handling.

Quick Start

Provide the path to the source file(s) and an optional scope (unit, integration, or all) to generate pytest-based tests.

Frequently Asked Questions about test-generator

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

FAQPage Schema
How do I auto-generate pytest tests from Python source code?

You can auto-generate pytest tests by providing the source file path and an optional scope parameter to produce ready-to-run templates with fixtures, parameterized cases, and AAA pattern structure.

What is the AAA pattern in pytest and how does it structure test generation?

The AAA pattern structures tests into Arrange, Act, and Assert sections. This test generator enforces AAA conformity to ensure consistent, readable test layouts across your Python project.

Can I generate both unit and integration tests for existing Python projects?

Yes, you can generate both unit and integration tests for existing Python projects by specifying the optional scope parameter as unit, integration, or all during the generation process.

Does the generated test suite include pytest fixtures and parameterized test cases?

Yes, the generated pytest test suite includes reusable fixtures and parameterized test cases. It creates templates covering typical usage, edge cases, and error handling for public APIs.

What's the best way to enforce naming conventions and test structure across a Python project?

The best way to enforce naming conventions and test structure is to auto-generate pytest tests using convention-testing rules, which apply descriptive names and Arrange-Act-Assert layouts consistently across modules.