Agent skill · Testing & QA

python-testing-patterns

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.

Seth Hobson38,331★ · +219/wk · 1 repos on radarProfile →
claude-codecodexcopilotcursorMIT
Install
npx skills add wshobson/agents --skill python-testing-patterns --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 3
SKILL.md size: 7 KB
Bundled scripts: none
Path: plugins/python-development/skills/python-testing-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 38,479 · +148 this week
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Python Testing Patterns Comprehensive guide to implementing robust testing strategies in Python using pytest, fixtures, mocking, parameterization, and test-driven development practices. ## When to Use This Skill - Writing unit tests for Python code - Setting up test suites and test infrastructure - Implementing test-driven development (TDD) - Creating integration tests for APIs and services - Mocking external dependencies and services - Testing async code and concurrent operations - Setting up continuous testing in CI/CD - Implementing property-based testing - Testing database operations - Debugging failing tests ## Core Concepts ### 1. Test Types - **Unit Tests**: Test individual functions/classes in isolation - **Integration Tests**: Test interaction between components - **Functional Tests**: Test complete features end-to-end - **Performance Tests**: Measure speed and resource usage ### 2. Test Structure (AAA Pattern) - **Arrange**: Set up test data and preconditions - **Act**: Execute the code under test - **Assert**: Verify the results ### 3. Test Coverage - Measure what code is exercised by tests - Identify untested code paths - Aim for meaningful coverage, not just high per

What's inside
Steps it walks through
  1. When to Use This Skill
  2. Core Concepts
  3. 1. Test Types
  4. 2. Test Structure (AAA Pattern)
  5. 3. Test Coverage
  6. 4. Test Isolation
  7. Quick Start
  8. Detailed patterns and worked examples
  9. Testing Best Practices
  10. Test Organization
  11. Test Naming Convention
  12. Testing Retry Behavior
  13. Mocking Time with Freezegun
  14. Test Markers
Ships with 2 files
  • references/advanced-patterns.md
  • references/details.md
Commands it runs
Install coverage
pip install pytest-cov
Run tests with coverage
pytest --cov=myapp tests/
Generate HTML report
pytest --cov=myapp --cov-report=html tests/
Fail if coverage below threshold
pytest --cov=myapp --cov-fail-under=80 tests/
Show missing lines
pytest --cov=myapp --cov-report=term-missing tests/
More from agents
All skills →
About this skill
What does the python-testing-patterns skill do?

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.

How do I install it?

Run `npx skills add wshobson/agents --skill python-testing-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From wshobson/agents, a repository with 38,479 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going