test-cases

Generate pytest test cases for FastAPI endpoints from API documentation and source code.

11|3|Updated Aug 31, 2025
One-click install
npx skills add https://github.com/tonehq/tone --skill test-cases-tonehq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-cases
Source: https://github.com/tonehq/tone/tree/main/.claude/skills/test-cases
Command: npx skills add https://github.com/tonehq/tone --skill test-cases-tonehq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate and maintain pytest test cases for FastAPI endpoints by reading the APIs.md documentation and tracing actual controller/service code. Creates one test file per controller with comprehensive coverage (success, failure, validation, auth, edge cases).

Core Features & Use Cases

  • Automated test generation: Build complete test suites from API docs and source code.
  • Trace-driven validation: Align tests with implemented controllers to cover edge cases.
  • Use Case: When you need to rapidly add test coverage for a growing FastAPI project, or regenerate tests after API drift.

Quick Start

Use the test-cases skill to generate pytest tests for your FastAPI endpoints.

Frequently Asked Questions about test-cases

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

FAQPage Schema
How do I generate pytest test cases for FastAPI endpoints?

Generate pytest tests for FastAPI by reading APIs.md and tracing actual controller and service code. This creates one test file per controller with comprehensive coverage across success, failure, validation, and authentication scenarios.

What is trace-driven API test generation and when do I need it?

Trace-driven API test generation aligns pytest tests with implemented FastAPI controllers to cover edge cases. You need it when adding test coverage for a growing project or regenerating tests after API drift between documentation and source code.

Can I use automated test generation for FastAPI projects with multiple controllers?

Yes, automated test generation supports FastAPI projects needing rapid, full test coverage across multiple controllers. It produces one test file per controller, scaling coverage without manual test scaffolding.

What is the best way to maintain pytest tests when FastAPI endpoints change?

The best way to maintain pytest tests after API drift is regenerating them from APIs.md and controller code. This trace-driven validation realigns test suites with updated endpoint implementations to cover new edge cases.

Do I need an APIs.md file to automate pytest test generation?

Yes, an APIs.md file documenting endpoints is required to automate pytest test generation. The tool reads this API documentation while tracing actual controller and service code to build complete test suites.