pluginagentmarketplace/custom-plugin-python/pytest-testing
Claude Code and agent skill by pluginagentmarketplace/custom-plugin-python
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Master test-driven development with pytest, fixtures, mocking, and CI/CD integration
Install
npx vskill@latest install pluginagentmarketplace/custom-plugin-python/pytest-testingSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Pytest Testing
Overview
Master software testing with pytest, Python's most popular testing framework. Learn test-driven development (TDD), write maintainable tests, and ensure code quality through comprehensive testing strategies.
Learning Objectives
- Write unit, integration, and functional tests with pytest
- Use fixtures for test setup and teardown
- Mock external dependencies effectively
- Implement test-driven development (TDD)
- Measure and improve code coverage
- Integrate tests with CI/CD pipelines
Core Topics
1. Pytest Basics
- Test discovery and naming conventions
- Assertions and comparison
- Test organization (files, classes, modules)
- Running tests (command-line options)
- Markers and test selection
- Parametrized tests
Code Example:
2. Fixtures & Test Setup
- Fixture scopes (function, class, module, session)
- Fixture dependencies
- Parametrized fixtures
- Built-in fixtures (tmpdir, capsys, monkeypatch)
- conftest.py for shared fixtures
Code Example:
3. Mocking & Test Doubles
- unittest.mock basics
- Mocking functions and methods
- Patching objects
- Mock assertions
- Side effects and return values
- Testing with external dependencies
Code Example:
4. Coverage & CI/CD Integration
- Measuring code coverage with pytest-cov
- Coverage reports (terminal, HTML, XML)
- Setting coverage thresholds
- GitHub Actions integration
- GitLab CI integration
- Pre-commit hooks
Code Example:
Hands-On Practice
Project 1: Calculator TDD
Build a calculator using test-driven development.
Requirements:
- Write tests BEFORE implementation
- Basic operations (add, subtract, multiply, divide)
- Error handling (division by zero)
- Scientific operations (power, sqrt, log)
- Test coverage > 90%
Key Skills: TDD workflow, parametrized tests, exception testing
Project 2: API Testing Suite
Create comprehensive test suite for a REST API.
Requirements:
- Mock HTTP requests
- Test CRUD operations
- Error handling tests
- Authentication tests
- Integration tests
- CI/CD pipeline setup
Key Skills: Mocking, fixtures, integration testing
Project 3: Database Testing
Test database operations with fixtures and transactions.
Requirements:
- Setup test database fixture
- Test CRUD operations
- Transaction rollback
- Data validation
- Performance tests
- Coverage report
Key Skills: Database fixtures, cleanup, performance testing
Assessment Criteria
- [ ] Write clear, maintainable tests
- [ ] Use fixtures appropriately
- [ ] Mock external dependencies effectively
- [ ] Achieve >80% code coverage
- [ ] Follow TDD principles
- [ ] Integrate tests with CI/CD
- [ ] Write meaningful assertions
Resources
Official Documentation
- Pytest Docs - Official documentation
- pytest-cov - Coverage plugin
- unittest.mock - Mocking library
Learning Platforms
- Test-Driven Development with Python - TDD book
- Python Testing with pytest - Brian Okken's book
- Real Python Testing - Tutorials
Tools
- pytest-xdist - Parallel testing
- pytest-mock - Mocking helper
- Hypothesis - Property-based testing
- tox - Testing automation
Next Steps
After mastering pytest, explore:
- Property-based testing - Hypothesis library
- Performance testing - pytest-benchmark
- Mutation testing - mutmut
- Load testing - Locust, pytest-load
Security
- Security scanPassed, 100 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 repositoryCheckingskills/pytest-testing/SKILL.md
Popularity
- Repository stars
- 5
- Repository forks
- 1
- 7-day trend score
- 9
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 1 May 2026, 7 months ago.
Extension points
hookPre/post lifecycle hooks
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/pluginagentmarketplace/custom-plugin-python/pytest-testing)