python-testing-best-practices
Improves Python test suite quality and coverage.
Install
mkdir -p .claude/skills/python-testing-best-practices && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13559" && unzip -o skill.zip -d .claude/skills/python-testing-best-practices && rm skill.zipInstalls to .claude/skills/python-testing-best-practices
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.
Design, implement, review, and modernize Python tests with an emphasis on pytest, Hypothesis, and AI-era evaluation workflows. Use when Codex needs to add or fix tests, improve flaky or slow suites, review pytest structure and fixture usage, introduce property-based testing, or separate deterministic code tests from eval-style checks for LLM or agent behavior.Key capabilities
- →Design Python tests for AI-assisted implementation.
- →Implement tests using `pytest` defaults and `Hypothesis` for invariants.
- →Review `pytest` structure and fixture usage.
- →Separate deterministic code tests from evaluation-style checks.
- →Improve flaky or slow test suites.
How it works
This skill guides the design and implementation of Python tests by prioritizing fast deterministic checks at the lowest layer, using `pytest` and `Hypothesis`, and separating deterministic code tests from non-deterministic model evaluations.
Inputs & outputs
When to use python-testing-best-practices
- →Modernizing legacy python tests
- →Implementing property-based testing
- →Fixing flaky test suites
- →Configuring pytest fixtures
About python-testing-best-practices
Guides the creation of efficient, stable tests. Promotes property-based testing and separates deterministic tests from non-deterministic model evaluations.
Design, implement, review, and modernize Python tests with an emphasis on pytest, Hypothesis, and AI-era evaluation workflows. Use when Codex needs to add or fix tests, improve flaky or slow suites, review pytest structure and fixture usage, introduce property-based testing, or separate deterministi
When not to use it
- →When the task is not related to Python testing.
- →When the task involves non-deterministic LLM or agent behavior that cannot be reduced to deterministic assertions.
Limitations
- →This skill focuses on Python testing with `pytest` and `Hypothesis`.
- →It requires inspecting local test configurations before proposing changes.
- →It assumes generated tests may be overfit to the implementation.
How it compares
This skill emphasizes creating trustworthy tests for AI-assisted implementations by focusing on deterministic checks and property-based testing, which is more resilient to code changes than example-based testing.
Compared to similar skills
python-testing-best-practices side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| python-testing-best-practices (this skill) | 0 | 4mo | Review | Advanced |
| python-testing-patterns | 77 | 2mo | Review | Intermediate |
| backtesting-frameworks | 17 | 2mo | No flags | Advanced |
| temporal-python-testing | 8 | 3mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
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.
testing-python
jlowin
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.
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".