grey-haven-tdd-python

Implement Python features using pytest with the red-green-refactor TDD cycle.

29|4|Updated Aug 10, 2025
One-click install
npx skills add https://github.com/greyhaven-ai/claude-code-config --skill grey-haven-tdd-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grey-haven-tdd-python
Source: https://github.com/greyhaven-ai/claude-code-config/tree/main/grey-haven-plugins/core/skills/tdd-python
Command: npx skills add https://github.com/greyhaven-ai/claude-code-config --skill grey-haven-tdd-python

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the time-consuming manual process of writing and maintaining Python tests, ensuring your code is robust and reliable from day one.

Core Features & Use Cases

  • Test-Driven Development: Implement features following strict red-green-refactor methodology with comprehensive test coverage.
  • Framework Expertise: Master pytest and unittest with advanced patterns for fixtures, mocking, and async testing.
  • Use Case: Imagine building a FastAPI endpoint. Use this Skill to write tests first, then implement the endpoint logic, ensuring 95%+ test coverage and catching bugs before deployment.

Quick Start

Use the grey-haven-tdd-python skill to help me write pytest tests for a new shopping cart feature in my e-commerce application.

Frequently Asked Questions about grey-haven-tdd-python

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

FAQPage Schema
How do I implement test-driven development with pytest in Python?

Test-driven development with pytest involves writing tests first, then implementing code to pass them using the red-green-refactor cycle. This approach ensures comprehensive test coverage and catches bugs early, making your Python code more reliable from the start.

Can I use pytest for FastAPI endpoint testing?

Yes, pytest is ideal for FastAPI testing. This Skill covers pytest patterns specifically for testing FastAPI endpoints, including fixtures, mocking, and async testing, ensuring your endpoints are thoroughly validated before deployment.

What's the best way to structure pytest tests for Pydantic model validation?

Pytest templates and test-first design patterns provide structured approaches to validate Pydantic models comprehensively. The Skill covers unit and integration test scenarios that ensure models handle all functional and technical requirements correctly.

Do I need pytest fixtures and mocking for effective TDD in Python?

Pytest fixtures and mocking are core patterns for TDD, enabling you to isolate code units and test edge cases efficiently. This Skill covers advanced fixture configuration and mocking strategies to build robust test suites with 95%+ coverage.

How do I achieve high test coverage when building Python features with TDD?

High test coverage comes from writing tests first across unit and integration scenarios, then implementing features incrementally. This Skill provides reusable templates and end-to-end TDD workflows to systematically reach and maintain 95%+ coverage.