pytest-gen
Generate comprehensive pytest tests - use when generating tests, creating test suites, or testing Python code
Best use case
pytest-gen is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Generate comprehensive pytest tests - use when generating tests, creating test suites, or testing Python code
Teams using pytest-gen should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/pytest-gen/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How pytest-gen Compares
| Feature / Agent | pytest-gen | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Generate comprehensive pytest tests - use when generating tests, creating test suites, or testing Python code
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Pytest Generation Skill
When generating tests, follow this structure.
## Test Organization
- Group tests by function under test
- Use `@pytest.mark.parametrize` for multiple inputs
- Use fixtures for shared setup
- Follow arrange/act/assert pattern
## Coverage Requirements
- Happy path (expected usage)
- Edge cases (empty strings, None, boundary values)
- Error cases (invalid input, file not found, wrong types)
- Integration (functions working together)
## Template
```python
import pytest
from module_under_test import function_to_test
@pytest.fixture
def sample_data():
"""Provide shared test data."""
return {"key": "value"}
class TestFunctionName:
"""Tests for function_name."""
def test_happy_path(self, sample_data):
result = function_to_test(valid_input)
assert result == expected_output
def test_empty_input(self):
result = function_to_test("")
assert result == expected_for_empty
@pytest.mark.parametrize("input_val,expected", [
("valid", True),
("", False),
(None, False),
])
def test_various_inputs(self, input_val, expected):
assert function_to_test(input_val) == expected
```Related Skills
hello-world
A minimal skill example - use when learning the skill format
commit-message
Generate conventional commit messages - use when creating commits, writing commit messages, or asking for git commit help
code-checklist
Team code quality checklist - use for checking Python code quality, bugs, security issues, and best practices
pytest-coverage
Run pytest tests with coverage, discover lines missing coverage, and increase coverage to 100%.
pytest-code-review
Reviews pytest test code for async patterns, fixtures, parametrize, and mocking. Use when reviewing test_*.py files, checking async test functions, fixture usage, or mock patterns.
pytest-test-generator
Pytest Test Generator - Auto-activating skill for Test Automation. Triggers on: pytest test generator, pytest test generator Part of the Test Automation skill category.
pytest Testing
Expert pytest framework for Python unit, integration, and functional testing
pytest-ml-tester
ML-specific testing skill using pytest with fixtures for data, models, and predictions.
compose-multiplatform-patterns
KMP项目中的Compose Multiplatform和Jetpack Compose模式——状态管理、导航、主题化、性能优化和平台特定UI。
java-coding-standards
Spring Bootサービス向けのJavaコーディング標準:命名、不変性、Optional使用、ストリーム、例外、ジェネリクス、プロジェクトレイアウト。
continuous-learning
Claude Codeセッションから再利用可能なパターンを自動的に抽出し、将来の使用のために学習済みスキルとして保存します。
nextjs-best-practices
Next.js App Router principles. Server Components, data fetching, routing patterns.