test-generator

Generate TDD-compliant test boilerplate with AAA pattern, type hints, and fixtures.

5|Updated Nov 2, 2025
One-click install
npx skills add https://github.com/Atyantik/python-modern-template --skill test-generator-atyantik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-generator
Source: https://github.com/Atyantik/python-modern-template/tree/main/.claude/skills/test-generator
Command: npx skills add https://github.com/Atyantik/python-modern-template --skill test-generator-atyantik

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Writing new tests, especially following strict TDD (Test-Driven Development) and project conventions, can be time-consuming and repetitive. This Skill automates the creation of test boilerplate, ensuring consistency and adherence to best practices from the start.

Core Features & Use Cases

  • TDD-Compliant Boilerplate: Generates tests with the Arrange-Act-Assert (AAA) pattern, complete with type hints, descriptive docstrings, and proper imports.
  • Multiple Test Types: Supports generating tests for functions, classes, async code, parametrized tests, and Pytest fixtures.
  • Quality Standards Enforcement: Ensures generated tests meet project-specific quality standards, including no excessive mocking and focus on edge cases.
  • Use Case: When starting a new feature, ask the AI to "generate tests for the validate_email function in src/python_modern_template/validators.py" to get a ready-to-use test file, allowing you to focus on implementing the actual code.

Quick Start

Generate tests for the process_data function in src/my_module/processor.py.

Frequently Asked Questions about test-generator

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

FAQPage Schema
How do I generate test boilerplate that follows TDD conventions?

Test generation creates comprehensive boilerplate with the Arrange-Act-Assert pattern, type hints, docstrings, and proper imports aligned to your project's TDD standards. Specify the function, class, or module you want tested, and the Skill produces ready-to-run pytest code matching your conventions.

Can I generate tests for async code and parametrized test cases?

Yes. The Skill supports multiple test types including async functions, parametrized tests, and pytest fixtures. It structures each test variant with appropriate decorators, type hints, and edge-case coverage while maintaining consistency with project quality standards.

What's the fastest way to set up test files for new modules without writing boilerplate?

Provide the module path and function or class name, and the Skill instantly generates complete test files with proper structure, imports, mocks guidance, and coverage focus. This lets you skip repetitive setup and move directly to writing implementation code.

Does test generation enforce code quality standards like reducing mocking?

Yes. Generated tests follow project-specific quality requirements, including emphasis on edge cases, minimal mocking, and alignment with documentation. The Skill ensures consistency and adherence to best practices from the first test file.

What do I need before generating tests for my codebase?

You need pytest installed and code you want to test—either a new function, class, or module. Provide the file path and target code element, and the Skill generates tests matching your project structure and conventions.

Why use automated test generation instead of writing tests manually?

Automated generation eliminates repetitive boilerplate, ensures consistent structure and type hints across your test suite, enforces TDD patterns immediately, and reduces time spent on test setup so you focus on implementation and edge-case logic.