
Python Testing
The python-testing skill teaches developers how to implement comprehensive testing strategies for Python applications using pytest, test-driven development (TDD), fixtures, mocking, and code coverage analysis. It's designed for Python developers writing new code or designing test suites who need structured guidance on testing infrastructure and best practices. The skill solves the problem of inconsistent testing approaches by providing concrete patterns for the TDD cycle (red-green-refactor), achieving 80%+ code coverage targets, and effectively using pytest features like fixtures and parametrization.
- install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
- 7
- skills.sh installs
- 6.6K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill python-testing --agent claude-codeInstalls into .claude/skills of the current project.
Files
Python Testing Patterns
Comprehensive testing strategies for Python applications using pytest, TDD methodology, and best practices.
When to Activate
- Writing new Python code (follow TDD: red, green, refactor)
- Designing test suites for Python projects
- Reviewing Python test coverage
- Setting up testing infrastructure
Core Testing Philosophy
Test-Driven Development (TDD)
Always follow the TDD cycle:
- RED: Write a failing test for the desired behavior
- GREEN: Write minimal code to make the test pass
- REFACTOR: Improve code while keeping tests green
# Step 1: Write failing test (RED)
def test_add_numbers():
result = add(2, 3)
assert result == 5
# Step 2: Write minimal implementation (GREEN)
def add(a, b):
return a + b
# Step 3: Refactor if needed (REFACTOR)
Coverage Requirements
- Target: 80%+ code coverage
- Critical paths: 100% coverage required
- Use
pytest --covto measure coverage
pytest --cov=mypackage --cov-report=term-missing --cov-report=html
pytest Fundamentals
Basic Test Structure
import pytest
Sponsors
Details
- Repository
- github.com/affaan-m/everything-claude-code
- Categories
- Testing & QA, Python
More from affaan-m/everything-claude-code
All 256- Video Editing6.6K
- Django Security6.5K
- Springboot Security6.4K
- Article Writing6.3K
- Prompt Optimizer6.3K
- Cpp Coding Standards6.2K
- Market Research6.2K
- Strategic Compact6.1K
- Android Clean Architecture6K
- Springboot Tdd6K
- Continuous Learning5.9K
- Database Migrations5.9K
- Django Tdd5.9K
- E2e Testing5.9K
- Liquid Glass Design5.9K
- Security Scan5.9K
- Deployment Patterns5.8K
- Jpa Patterns5.8K
- Laravel Patterns5.8K
- Clickhouse Io5.7K
- Eval Harness5.7K
- Laravel Security5.7K
- Cpp Testing5.6K
- Iterative Retrieval5.6K