python-testing

Enforce pytest-based Python testing with TDD and 80% coverage.

Updated May 9, 2026
One-click install
npx skills add https://github.com/kk20300113-png/my-claude-skills --skill python-testing-kk20300113-png
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-testing
Source: https://github.com/kk20300113-png/my-claude-skills/tree/main/python-testing
Command: npx skills add https://github.com/kk20300113-png/my-claude-skills --skill python-testing-kk20300113-png

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the inconsistency and gaps in ad-hoc Python testing, ensuring your code is reliable, well-covered, and built following proven Test-Driven Development principles to catch bugs early in the development cycle.

Core Features & Use Cases

  • pytest Best Practices: Full guidance on fixtures, parametrization, mocking, and markers to write clean, maintainable, and fast test suites.
  • TDD Workflow Guidance: Step-by-step red-green-refactor instructions to build features correctly the first time, reducing rework.
  • Use Case: When building a new Python web API, use this Skill to set up a test suite with 80%+ coverage, mock external payment and authentication services, and organize unit and integration tests for long-term maintainability.

Quick Start

Use the python-testing skill to write a failing pytest test for your new user authentication function, then implement the minimal code to make it pass following TDD principles.

Frequently Asked Questions about python-testing

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

FAQPage Schema
How do I set up pytest for a new Python project?▼

To set up pytest for Python testing, organize your test directory structures and use fixtures and markers to build a maintainable test suite that enforces 80%+ code coverage for your project.

What is the best way to mock external services in Python tests?▼

The best way to mock external services in Python testing is by applying proper mocking techniques within pytest to isolate external dependencies, ensuring reliable and focused unit tests.

How do I follow TDD principles when building Python features?▼

To follow TDD in Python testing, use the red-green-refactor workflow: write a failing pytest test first, then implement the minimal code required to pass it, reducing rework and catching bugs early.

How do I use pytest fixtures and parametrization effectively?▼

Use pytest fixtures and parametrization in Python testing to create clean, maintainable test suites that provide consistent setup contexts and run multiple input combinations efficiently.

Does TDD require 80% code coverage for Python applications?▼

TDD workflows target 80%+ code coverage for Python testing to ensure high reliability, applying proper fixture usage and organized test directory structures for long-term maintainability.