Python Testing
Pytest testing patterns covering TDD, fixtures, parametrization, mocking, and coverage targets for Python projects.
- CCM score
- 65 of 100
- skills.sh installs
- 14.3K
- GitHub stars
- 312.6K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers the red-green-refactor TDD cycle, pytest assertions, and exception testing with
pytest.raises - Includes fixture patterns (scopes, setup and teardown, parameterized fixtures, autouse, and
conftest.pysharing) plus parametrization and custom markers - Sets an 80% coverage target with 100% required on critical paths, measured with
pytest --cov - Designed for Python developers writing new code or reviewing test suites and coverage in pytest projects
Install
$ npx -y skills add affaan-m/ecc --skill python-testing -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Testing & QA, Python
- First seen
- Jul 14, 2026
Questions
What does the python-testing skill help an agent do?
The python-testing skill gives an agent strategies for testing Python code with pytest, following the TDD cycle of red, green and refactor. It covers fixtures, mocking, parametrization and coverage requirements, including a target of 80% or more code coverage.
How do I install the python-testing skill?
Run npx -y skills add affaan-m/ecc --skill python-testing -y in your project to install it. Once installed, the agent can apply pytest fixtures, mocks, parametrized tests and coverage checks when you write Python tests.
Where does python-testing rank in its category?
On Claude Marketplaces it sits in the Testing & QA category, where it ranks in the top 50. Other skills in that category include tdd, test-driven-development, webapp-testing and break-ui.
Which Python test patterns does this skill cover?
The skill covers basic pytest test structure, assertions, fixtures with setup and teardown, fixture scopes, parametrized tests and custom markers for selecting tests. It also includes mocking and patching examples for isolating external calls.
More from affaan-m/ecc
All 257- Laravel Security14.3K
- Android Clean Architecture14.3K
- Article Writing14.3K
- Cpp Coding Standards14.3K
- Springboot Security14.2K
- Liquid Glass Design14.2K
- Database Migrations14.1K
- E2e Testing14.1K
- Strategic Compact14K
- Laravel Patterns13.8K
- Verification Loop13.6K
- Codebase Onboarding13.6K
- Springboot Tdd13.4K
- Security Scan13.4K
- Django Tdd13.3K
- Deployment Patterns13.3K
- Search First13.3K
- Deep Research13.2K
- Eval Harness13.1K
- Continuous Learning13K
- Cpp Testing13K
- Jpa Patterns13K
- Rust Patterns12.9K
- Kotlin Coroutines Flows12.9K
Similar to Python Testing
More Testing & QApytest-patternsmanutej/luxor-claude-marketplace876 installsPytest fixtures, parametrization, and mocking patterns for reliable, maintainable Python test suites.
pytestgentleman-programming/gentleman-skills297 installsPytest testing patterns for Python covering fixtures, mocking, parametrization, and markers in one reference.
django-tddaffaan-m/ecc13.3K installsPytest-django test setup, factory_boy fixtures, and TDD workflow for Django and DRF apps.
rust-testingaffaan-m/ecc14.8K installsRust testing patterns covering unit, integration, async, property-based, and mocked tests under a TDD workflow.
test-driven-developmentbobmatnyc/claude-mpm-skills412 installsLanguage-agnostic TDD guide covering red-green-refactor, test structure, mocking, and coverage targets for any stack.
tdd-guidealirezarezvani/claude-skills1.1K installsTest-first development skill that generates tests, mocks, and coverage analysis across Jest, Pytest, JUnit, Vitest, and Mocha.