$npx skillfedfor your agent

python-testing

Learn pytest essentials and test-driven development patterns for Python projects. This skill covers fixtures, parametrization, mocking, and coverage strategies to build reliable test suites. Follow the red-green-refactor cycle and achieve 80%+ code coverage on your critical paths.

Python Testing teaches pytest fundamentals, TDD methodology, fixtures, and parametrization for comprehensive Python test coverage.

AI-generated summary based on this skill's SKILL.md

234,207 35,692 MITupdated by affaan-m

Decision gist · record as of 2026-07-27

Python Testing teaches pytest fundamentals, TDD methodology, fixtures, and parametrization for comprehensive Python test coverage. Learn pytest essentials and test-driven development patterns for Python projects. This skill covers fixtures, parametrization, mocking, and coverage strategies to build reliable test suites. Follow the red-green-refactor cycle and achieve 80%+ code coverage on your critical paths.

manual: git clone https://github.com/affaan-m/ECC → cp -r ECC/skills/python-testing ~/.claude/skills/python-testing
skills/python-testing/SKILL.md · version 9f49a21c

Use it when

  • python-testing guides you through pytest fundamentals and test structure for Python projects.
  • python-testing covers the test-driven development (TDD) workflow with red-green-refactor as a core pattern.

Verify before relying

Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

affaan-m/ECC/python-testing · repository language: JavaScript

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is python-testing and how does it help me write better tests?

python-testing teaches pytest essentials and test-driven development patterns for Python projects. The skill covers fixtures, parametrization, mocking, and coverage strategies to build reliable test suites. You'll learn to follow the red-green-refactor cycle and achieve 80%+ code coverage on your critical paths, ensuring your code is thoroughly validated before deployment.

How do I write python unit testing with pytest?

python-testing guides you through pytest fundamentals and test structure for Python projects. You'll learn how to organize tests, write assertions, use fixtures for setup and teardown, and apply parametrization to test multiple scenarios efficiently. The skill emphasizes learning pytest's core features and best practices for structuring test files and test functions to maximize clarity and maintainability.

What is the red-green-refactor cycle in test-driven development?

python-testing covers the test-driven development (TDD) workflow with red-green-refactor as a core pattern. Red means writing a failing test first; green means writing minimal code to pass it; refactor means improving the code while keeping tests passing. This cycle ensures your implementation is always validated and helps you design better APIs and catch bugs early.

How do I set up pytest fixtures and mocking for comprehensive coverage?

python-testing teaches you to set up fixtures, mocking, and parametrization for comprehensive test coverage. Fixtures provide reusable setup and teardown logic; mocking lets you safely test code that depends on external services or databases without actually calling them. You'll learn conftest patterns for sharing fixtures across tests and techniques for mocking API calls and database operations.

Can python-testing help me achieve 80%+ code coverage?

Yes. python-testing includes strategies for achieving 80%+ code coverage and testing critical paths thoroughly. The skill teaches you how to identify which code paths matter most, use coverage tools to measure your progress, and apply parametrization and fixtures to test edge cases and error conditions systematically.

How do I test async code and exceptions with pytest?

python-testing covers testing async code, exceptions, and external dependencies safely. You'll learn pytest plugins and patterns for async testing, how to assert that specific exceptions are raised, and techniques for mocking external dependencies so your tests remain fast and isolated. This ensures your async workflows and error handling are robust.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

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:

  1. RED: Write a failing test for the desired behavior
  2. GREEN: Write minimal code to make the test pass
  3. 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 --cov to measure coverage

```bash pytest

(truncated - see the full file via the links below)

File tree — 1 file
skills/python-testing/SKILL.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Learn pytest fundamentals and test structure for Python projects”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

Pytest Patterns
by manutej · manutej/luxor-claude-marketplace

Pytest Patterns teaches you to write reliable Python tests using pytest's core features—fixtures for setup and teardown, parametrization to run tests with multiple inputs, and mocking to isolate dependencies. Learn test organization, coverage analysis, and CI/CD integration to scale from simple unit tests to complex test suites.

no license declared → metadata onlyupdated Jun 2026
★ 61repo stars
Pytest Testing
by pluginagentmarketplace · pluginagentmarketplace/custom-plugin-python

Master pytest through test-driven development, fixtures, and mocking strategies. Build comprehensive test suites with parametrized tests, external dependency mocking, and CI/CD pipeline integration while measuring code coverage.

no license declared → metadata onlyupdated Jan 2026
★ 5repo stars
python-testing
by xu-xiang · xu-xiang/everything-claude-code-zh

Learn to build robust Python tests using pytest with test-driven development principles. This skill covers fixtures for setup and teardown, parametrization for running tests across multiple inputs, mocking to isolate dependencies, and achieving meaningful code coverage targets.

MITdocs in Chineseupdated Mar 2026
★ 1,767repo stars
pytest-skill
by LambdaTest · LambdaTest/agent-skills

pytest-skill equips you with patterns for writing robust Python tests using pytest's core features: fixtures for setup and teardown, parametrize for data-driven testing, markers for test organization, and mocking for external dependencies. It covers conftest configuration, exception handling, and best practices for production environments.

MITupdated Jul 2026
★ 339repo stars
Test Implement Constructor Validation
by dawiddutoit · dawiddutoit/custom-claude

This skill automates the creation of constructor validation tests for Python service classes. It analyzes service __init__ methods to generate pytest test cases that verify required parameters raise ValueError when None, following the fail-fast principle.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars
pytest
by bobmatnyc · bobmatnyc/claude-mpm-skills

pytest is Python's standard testing framework, enabling developers to write organized unit and integration tests through fixtures for dependency injection and parametrization for data-driven test cases. It supports async code, multiple test discovery patterns, and integrates seamlessly with FastAPI, Django, and Flask, plus a rich plugin ecosystem for coverage, mocking, and parallel execution.

MITupdated Jul 2026
★ 62repo stars

More skills python-testing-patterns (MIT) · python-testing-patterns (MIT) · Mcp (Unlicense) · pytest (MIT) · python-testing (MIT) · python-testing-patterns (MIT) · Pytest Coder (NOASSERTION)

Tags
test-automationquality-assurancebehavior-drivenmock-patchingtest-isolationcontinuous-integrationregression-testingfixture-managementassertion-patterns