pytest — Claude Code skill: what it does, how to install
Teaches the agent to write tests for support APIs, databases, and background jobs using FastAPI and SQLAlchemy. Sets up pytest fixtures and async tests.
npx skills add manutej/luxor-claude-marketplace --skill pytest -a claude-codeWhat pytest does
This skill guides the coding agent through writing backend tests for customer support infrastructure. It focuses on FastAPI endpoints, database transactions in PostgreSQL, and ticket processing workflows.
Inside are patterns for fixture scoping. The database engine initializes once per session, while individual test functions receive isolated sessions with automatic rollbacks. It also provides patterns for mocking third-party email providers and CRM webhooks.
The test suite relies on pytest>=8.0.0, pytest-asyncio>=0.23.0, and sqlalchemy>=2.0.0. Running these suites without the matching pytest plugins will break test discovery immediately.
What it helps with
- Create database fixtures with automatic transaction rollbacks in PostgreSQL
- Test asynchronous task queues and webhook deliveries
- Write test suites for FastAPI ticket endpoints
- Mock third-party services for email and CRM integrations
Example prompts for the agent
- Write a pytest database session fixture in SQLAlchemy with automatic rollback for each test
- Create a test for an async FastAPI ticket creation route with Pydantic payload validation
- Mock the external email provider using pytest-mock to test SLA escalation logic
How to install pytest
1Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest -a claude-code2Manually: put the files in place
~/.claude/skills/pytest/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pytest/
1Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest -a codex2Manually: put the files in place
.agents/skills/pytest/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest -a cursor2Manually: put the files in place
.cursor/skills/pytest/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install manutej/luxor-claude-marketplace pytest2Manually: put the files in place
.github/skills/pytest/SKILL.md1Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest -a gemini-cli2Platform CLI
gemini skills install https://github.com/manutej/luxor-claude-marketplace --path plugins/luxor-testing-essentials/skills/pytestManually: put the files in place
.devin/skills/pytest/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add manutej/luxor-claude-marketplace --skill pytest -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
How to install pytest in Claude Code?
Run npx skills add manutej/luxor-claude-marketplace --skill pytest -a claude-code in your terminal. The configuration installs to ~/.claude/skills/pytest/SKILL.md.
What does the pytest skill do?
It equips the agent with patterns for testing customer support backends. The agent writes structured fixtures, mocks, and async test cases for FastAPI, SQLAlchemy, and PostgreSQL.
Which libraries are required for these tests?
Your project needs pytest>=8.0.0, pytest-asyncio>=0.23.0, pytest-mock>=3.12.0, fastapi>=0.109.0, and sqlalchemy>=2.0.0.