api-integration-expert

Generate and execute FastAPI integration tests with pytest and httpx.

3|Updated May 3, 2026
One-click install
npx skills add https://github.com/ductoanoxo/Agent_SQL --skill api-integration-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-integration-expert
Source: https://github.com/ductoanoxo/Agent_SQL/tree/main/.agents/skills/testing/api-integration
Command: npx skills add https://github.com/ductoanoxo/Agent_SQL --skill api-integration-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you create reliable API integration tests for FastAPI services so you can validate request/response behavior without calling real external providers or production databases.

Core Features & Use Cases

  • Pytest + httpx Async integration: Uses httpx AsyncClient with ASGITransport to test FastAPI endpoints without running a live server.
  • Data-driven test cases: Loads dynamically generated test cases from the required JSON output produced by the test-case-generation skill.
  • Deterministic mocking: Enforces dependency_overrides and mocking to avoid real LLM/database calls and keep tests fast and safe.
  • Automated results reporting: When requested, runs pytest and then generates a Markdown report with pass/fail summary for downstream reporting.

Quick Start

Ask the assistant to write and run API integration tests for your FastAPI service using pytest and httpx, ensuring all external services and databases are mocked and results are saved to the required output locations.

Frequently Asked Questions about api-integration-expert

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

FAQPage Schema
How do I test FastAPI endpoints without running a live server?

FastAPI endpoints can be tested without a live server by using httpx AsyncClient with ASGITransport. This approach connects the client directly to the application's ASGI app, enabling async request execution and verification in an isolated test environment.

How do I mock external services in FastAPI integration tests?

Mock external services in FastAPI integration tests by applying FastAPI dependency_overrides. This replaces real database and LLM calls with deterministic mocks, keeping tests fast and safe without touching production providers.

Can I use pytest-asyncio to run data-driven API tests for FastAPI?

Yes, pytest-asyncio is required to execute async FastAPI API tests. The skill loads dynamically generated test cases from JSON output and runs them within an async context using httpx AsyncClient.

Why does my FastAPI integration test fail when calling external databases?

FastAPI integration tests fail on external calls because real databases and providers are not mocked. You must enforce dependency_overrides and mocking to prevent live network requests and ensure deterministic pass/fail results.

What is the best way to generate pytest reports for API testing?

The best way to generate pytest reports for API testing is to run pytest and output the pass/fail summary to a Markdown file. This provides downstream reporting for automated test result tracking.

Do I need a specific test directory structure for FastAPI integration tests?

Yes, a strict test directory structure is enforced for FastAPI integration tests. This ensures dynamic test cases loaded from JSON output are correctly discovered and executed within the pytest async context.