francostino/opencode-skills-collection/pytest-skill
Claude Code and agent skill by francostino/opencode-skills-collection
- community
Checking that the SKILL.md file is still in the repository.
Generates production-grade pytest tests in Python with fixtures, parametrize, markers, mocking, and conftest patterns. Use when user mentions \"pytest\", \"conftest\", \"@pytest.fixture\", \"@pytest.mark\", \"Python test\".
Install
npx vskill@latest install francostino/opencode-skills-collection/pytest-skillSKILL.md
The same SKILL.md was published earlier as francostino/opencode-skills-collection/pytest-skill.
Pytest Testing Skill
When to Use
Use this skill when you need generates production-grade pytest tests in Python with fixtures, parametrize, markers, mocking, and conftest patterns. Use when user mentions "pytest", "conftest", "@pytest.fixture", "@pytest.mark", "Python test". Triggers on: "pytest", "conftest", "Python test", "parametrize", "Python...
Core Patterns
Basic Test
Fixtures
Parametrize
Markers
Mocking
Assertions
Anti-Patterns
| Bad | Good | Why | |
|---|---|---|---|
self.assertEqual() | assert x == y | pytest rewrites give better output | |
Setup in __init__ | @pytest.fixture | Lifecycle management | |
| Global state | Fixture with yield | Proper cleanup | |
| Huge test functions | Small focused tests | Easier debugging |
Quick Reference
| Task | Command | |
|---|---|---|
| Run all | pytest | |
| Run file | pytest tests/test_login.py | |
| Run specific | pytest tests/test_login.py::test_login_success | |
| By marker | pytest -m slow | |
| By keyword | pytest -k "login and not invalid" | |
| Verbose | pytest -v | |
| Stop first fail | pytest -x | |
| Last failed | pytest --lf | |
| Coverage | pytest --cov=myapp --cov-report=html | |
| Parallel | pytest -n auto (pytest-xdist) |
pyproject.toml
Deep Patterns
For production-grade patterns, see reference/playbook.md:
| Section | What's Inside | |
|---|---|---|
| §1 Config | pytest.ini + pyproject.toml with markers, coverage | |
| §2 Fixtures | Scoping, factories, teardown, autouse, tmp_path | |
| §3 Parametrize | Basic, with IDs, cartesian, indirect | |
| §4 Mocking | pytest-mock, monkeypatch, spies, env vars | |
| §5 Async | pytest-asyncio, async fixtures, async client | |
| §6 Exceptions | pytest.raises(match=), warnings | |
| §7 Markers & Plugins | Custom markers, collection hooks | |
| §8 Class-Based | Nested classes, autouse setup | |
| §9 CI/CD | GitHub Actions matrix, coverage gates | |
| §10 Debugging Table | 10 common problems with fixes | |
| §11 Best Practices | 15-item production checklist |
Limitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingbundled-skills/pytest-skill/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/francostino/opencode-skills-collection/pytest-skill)