pytest-patterns — Claude Code skill: what it does, how to install
Python testing guide for pytest. Helps coding assistants generate clean fixtures, manage test lifecycles, and handle test parametrization.
npx skills add manutej/luxor-claude-marketplace --skill pytest-patterns -a claude-codeWhat pytest-patterns does
This skill guides AI assistants on structuring Python test suites with pytest. It establishes discovery rules across test_*.py files and plain functions, replacing boilerplate unittest.TestCase classes with clear assert expressions.
It details fixture design patterns across all lifecycle scopes, from isolated test functions to session-level database setups. The guidance covers teardown steps via yield and factory functions that yield mock models. It also introduces parametrization techniques using marks and labeled inputs for edge case coverage.
A test class defining __init__ breaks default pytest discovery. The skill ensures the assistant avoids such mistakes when scaffolding test files.
What it helps with
- Configure hierarchical fixtures with teardown via
yield - Parametrize test functions across multiple input combinations
- Migrate legacy
unittestsuites to idiomaticpytestassertions - Implement factory fixtures to generate mock domain entities
Example prompts for the agent
- Create a session-scoped database fixture with automatic cleanup
- Parametrize this test function to cover edge cases and invalid inputs
- Refactor this
unittesttest suite into cleanpytestconventions
How to install pytest-patterns
1Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest-patterns -a claude-code2Manually: put the files in place
~/.claude/skills/pytest-patterns/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pytest-patterns/
1Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest-patterns -a codex2Manually: put the files in place
.agents/skills/pytest-patterns/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest-patterns -a cursor2Manually: put the files in place
.cursor/skills/pytest-patterns/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install manutej/luxor-claude-marketplace pytest-patterns2Manually: put the files in place
.github/skills/pytest-patterns/SKILL.md1Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest-patterns -a gemini-cli2Platform CLI
gemini skills install https://github.com/manutej/luxor-claude-marketplace --path plugins/luxor-testing-essentials/skills/pytest-patternsManually: put the files in place
.devin/skills/pytest-patterns/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest-patterns -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about pytest-patterns
How to install pytest-patterns in Claude Code?
Run npx skills add manutej/luxor-claude-marketplace --skill pytest-patterns -a claude-code. This installs the skill file into your local Claude environment.
What does pytest-patterns do?
It instructs your AI assistant on standard Python testing patterns. It provides clear rules for fixtures, parametrization, and test suite organization.
Which fixture scopes does the guide cover?
It covers function, class, module, package, and session scopes. These tiers control how frequently setup and teardown routines run during a suite execution.