python-testing

Automate Python testing workflows with pytest, fixtures, mocking, and coverage reports.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/IwatsukaYura/harness_template --skill python-testing-iwatsukayura
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-testing
Source: https://github.com/IwatsukaYura/harness_template/tree/main/.claude/skills/python-testing
Command: npx skills add https://github.com/IwatsukaYura/harness_template --skill python-testing-iwatsukayura

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides Python testing patterns and best practices to help teams implement robust tests using pytest, TDD, fixtures, mocking, and explicit coverage targets.

Core Features & Use Cases

  • TDD guidance and the RED-GREEN-REFACTOR cycle to drive small, verifiable progress.
  • Fixtures, parametrization, and structured test organization to increase test reliability and reusability.
  • Mocking and patching strategies for isolating components and simulating edge cases; guidance on writing maintainable tests.
  • Coverage targets and reporting via pytest-cov to ensure critical paths are exercised across projects.

Quick Start

Create a failing test first, implement the minimal code to pass it, then refactor while expanding coverage.

Frequently Asked Questions about python-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure pytest fixtures for reusable test automation?

Structure pytest fixtures by defining modular setup functions that inject dependencies into tests, ensuring repeatable test automation. This skill provides patterns for fixture organization, parametrization, and mocking to isolate components and increase test reusability across Python projects.

What is the TDD red-green-refactor cycle in Python testing?

The TDD red-green-refactor cycle in Python testing drives verifiable progress by writing a failing test first, implementing minimal code to pass it, then refactoring. This skill enforces TDD workflows to build structured test suites with clear guidance on setup and organization.

How do I generate coverage reports with pytest-cov for Python projects?

Generate coverage reports with pytest-cov by configuring explicit coverage targets that ensure critical paths are exercised. This skill automates Python testing workflows to satisfy requirements for generating coverage reports and enforcing high coverage across projects.

Can I use mocking and patching to isolate components in pytest test suites?

Yes, you can use mocking and patching to isolate components and simulate edge cases in pytest test suites. This skill provides guidance on writing maintainable tests with mocking patterns to increase test reliability and component isolation.

What's the best way to organize parametrized tests in Python for test discovery?

Organize parametrized tests by applying structured test organization patterns that increase reliability and satisfy automatic test discovery requirements. This skill guides parametrization, structured organization, and repeatable runs to ensure critical paths are exercised across Python projects.