python-testing-patterns Skill (wshobson) for Claude: What It Does and How to Install It
Makes Claude write Python tests the pytest way: fixtures, mocking, parametrized tests, async tests and CI setup.
- Installs
- 38.9K
- on skills.sh
- Stars
- 42.1K
- on GitHub
- Files
- 2
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
This skill is a testing guide for Claude, from wshobson's agents collection. It covers the arrange, act, assert structure, test isolation, fixtures, mocking with unittest.mock, parametrized tests, markers and coverage.
The main file keeps the basics. Worked examples are in references/details.md, and async, monkeypatch, property-based and database tests plus CI setup are in references/advanced-patterns.md. It loads when you write tests, set up a test suite or debug failing tests.
Good for
- Python developers writing or fixing pytest suites
- Teams setting up test infrastructure and coverage reports
- Anyone practising test-driven development in Python
- Developers mocking APIs, time or databases in tests
Install python-testing-patterns
Claude Code
- 1
Copy this prompt.
Install the python-testing-patterns skill in Claude Code. Run this command: /plugin marketplace add wshobson/agents /plugin install python-development@claude-code-workflows Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Pick one route. The plugin routes install the whole python-development plugin: 3 agents, 1 command and 16 skills (counted from the plugin folder in the repo tree, which has no hooks or MCP config files). The skills-only routes install just this skill, with no agents or commands. The skill needs Python and pytest in your own project.
From the project README. Source.
What's in the skill
When it loads
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.
Sections in SKILL.md
- When to Use This Skill
- Core Concepts
- 1. Test Types
- 2. Test Structure (AAA Pattern)
- 3. Test Coverage
- 4. Test Isolation
- Quick Start
- Detailed patterns and worked examples
- Testing Best Practices
- Test Organization
- Test Naming Convention
- Testing Retry Behavior
- Mocking Time with Freezegun
- Test Markers
- Coverage Reporting
Key facts
- Author
- wshobson (repo owner)
- License
- MIT
- Installs on skills.sh
- 38,856 (Nov 2, 2026)
- Last repo commit
- Oct 30, 2026
What it includes
Unit, integration, functional and performance tests
Explains Arrange, Act, Assert, coverage and why tests must be independent.
Try: “Write pytest tests for this payment module with fixtures for the database.”
Read ·
Test types and AAASetup and teardown with fixtures (details.md)
Worked examples of simple tests and fixtures that clean up after themselves.
Write ·
Basic pytest and fixturesOne test, many inputs
Uses parametrize and pytest.param for special cases.
Write ·
Parameterized testsunittest.mock for APIs and services
Includes testing retry behavior with mock side effects.
Write ·
MockingChecks that errors are raised
Part of the fundamental patterns in details.md.
Write ·
Testing exceptionsfreezegun and pytest markers
Freezegun controls time in tests. Markers group and filter tests.
Write ·
Time and markersAsync, monkeypatch, temp files, conftest, property-based, database
Reference guide in references/advanced-patterns.md.
Read ·
Advanced patternsGitHub Actions workflow, pytest.ini and pyproject.toml
Also in advanced-patterns.md, along with coverage reporting.
Read ·
CI and configuration
From the official docs
Permissions
Low risk
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
The examples install Python packages
SKILL.md has a coverage example that starts with pip install pytest-cov, and advanced-patterns.md has a CI workflow with pip install -e ".[dev]" and pip install pytest pytest-cov. Install into a virtual environment and review any command before it runs. github.com
A CI workflow example would add a file under .github
advanced-patterns.md shows a .github/workflows/test.yml. If you ask for CI setup, review that file before you commit it. github.com
The plugin route installs more than this skill
The python-development plugin has 3 agents, 1 command and 16 skills. We found no hooks or MCP config files in its folder. The skills-only routes install only this skill. github.com
Security advisories
No published security advisories as of Nov 2, 2026.
Technical details
| Turning on read-only | No read-only mode. Use version control. |
|---|---|
| Talks to | Package downloads when you run the pip install commands. Whatever your own tests call |
| Sign-in and keys | SKILL.md and the two reference files do not mention any account or key. The examples read an optional DATABASE_URL environment variable inside test code. |
| Scopes |
|
Questions
What does the python-testing-patterns skill do?
It gives Claude a pytest playbook. Claude uses it to write unit and integration tests, fixtures, mocks and parametrized cases, and to set up coverage and CI.
How do I install python-testing-patterns?
Use the install box at the top of this page. It lists the plugin route and two skills-only commands: npx skills add wshobson/agents --skill python-testing-patterns and gh skill install wshobson/agents python-testing-patterns (GitHub CLI 2.90 or later), which skip the plugin's agents and commands.
Is this skill from Anthropic?
No. It is in wshobson/agents, a community collection. The skill sits in the python-development plugin there.
Should I install the whole python-development plugin?
Only if you want the rest. The README documents a plugin route for Claude Code and Codex. The plugin folder holds 3 agents, 1 command and 16 skills, and the repo tree shows no hooks or MCP config files in it. The install box offers the plugin and skills-only commands.
Does it only cover pytest?
Mostly. The description names pytest, fixtures, mocking and test-driven development, and the examples use pytest, unittest.mock and freezegun.
Does it work in Codex or Cursor?
The README documents Codex CLI as a plugin route and a skills-only install. For Cursor it points to a plugin marketplace and its setup docs, which we did not check, so follow the README there.
Is it safe?
Installing it runs nothing: it is a guide with two reference files and no scripts. When you ask for tests, Claude writes and may run them in your project. The examples use pip install pytest-cov and a CI workflow with pip install, so review those commands and any files it adds.
Information
updated Nov 2, 2026
- Repository
- wshobson/agents
- Folder
plugins/python-development/skills/python-testing-patterns
Sources
Docs, issue trackers and discussions this page is built from.
Show all 5Hide
- python-testing-patterns SKILL.md · github.com
- wshobson/agents README · github.com
- python-development plugin.json · github.com
- details.md · github.com
- advanced-patterns.md · github.com