This skill assists developers in writing focused, self-contained Python unit tests, including async and parameterized configurations.
Install
mkdir -p .claude/skills/testing-python && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/745" && unzip -o skill.zip -d .claude/skills/testing-python && rm skill.zipInstalls to .claude/skills/testing-python
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Write and evaluate effective Python tests using pytest. Use when writing tests, reviewing test code, debugging test failures, or improving test coverage. Covers test design, fixtures, parameterization, mocking, and async testing.Key capabilities
- →Design atomic unit tests for single behaviors
- →Implement parameterization for input variations
- →Mock external services using AsyncMock
- →Use in-memory transport for FastMCP testing
- →Generate and update inline snapshots for complex data
- →Verify error handling with pytest raises
How it works
The skill enforces atomic test design and specific pytest configurations like global async mode. It utilizes in-memory transport for server testing and inline snapshots for verifying complex data structures.
Inputs & outputs
When to use testing-python
- →Writing new unit tests for Python functions
- →Refactoring legacy code into testable units
- →Debugging failing pytest cases
- →Implementing test fixtures and parameterization
About testing-python
Guides developers in creating unit tests that are self-contained and focused on single behaviors. It covers project-specific requirements like async testing and parameterization to improve test coverage and maintenance.
Write and evaluate effective Python tests using pytest. Use when writing tests, reviewing test code, debugging test failures, or improving test coverage. Covers test design, fixtures, parameterization, mocking, and async testing.
When not to use it
- →Testing network features requiring HTTP transport
- →Parameterizing unrelated behaviors
- →Mocking internal classes
Prerequisites
Limitations
- →Requires manual exclusion of integration tests via markers
- →Restricts local imports within test functions
How it compares
Unlike manual testing, this approach mandates module-level imports and prohibits async decorators to maintain a standardized, project-specific testing structure.
Compared to similar skills
testing-python side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| testing-python (this skill) | 5 | 8mo | Review | Intermediate |
| python-testing-patterns | 77 | 4mo | Review | Intermediate |
| backtesting-frameworks | 17 | 4mo | No flags | Advanced |
| temporal-python-testing | 8 | 5mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by jlowin
View all by jlowin →You might also like
python-testing-patterns
wshobson
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
backtesting-frameworks
wshobson
Build robust backtesting systems for trading strategies with proper handling of look-ahead bias, survivorship bias, and transaction costs. Use when developing trading algorithms, validating strategies, or building backtesting infrastructure.
temporal-python-testing
wshobson
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
home-assistant-integration-knowledge
home-assistant
Everything you need to know to build, test and review Home Assistant Integrations. If you're looking at an integration, you must use this as your primary reference.
pr-review
pytorch
Review PyTorch pull requests for code quality, test coverage, security, and backward compatibility. Use when reviewing PRs, when asked to review code changes, or when the user mentions "review PR", "code review", or "check this PR".
pytest
prowler-cloud
Pytest testing patterns for Python. Trigger: When writing or refactoring pytest tests (fixtures, mocking, parametrize, markers). For Prowler-specific API/SDK testing conventions, also use prowler-test-api or prowler-test-sdk.