api-testing-patterns

Automate API test design with reusable HTTP, GraphQL, and schema validation utilities.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/romankovsv/claude-code-python-devops-mlops --skill api-testing-patterns-romankovsv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-testing-patterns
Source: https://github.com/romankovsv/claude-code-python-devops-mlops/tree/main/skills/api-testing-patterns
Command: npx skills add https://github.com/romankovsv/claude-code-python-devops-mlops --skill api-testing-patterns-romankovsv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

API testing often lacks reusable patterns and robust validation. This Skill provides a collection of reliable patterns and utilities to accelerate API test automation, enforce consistency, and improve test reliability.

Core Features & Use Cases

  • HTTP Client wrappers with logging and test utilities
  • Pydantic-based response validation
  • Faker-based test data factories
  • Waiter for polling and retry logic
  • Retry decorator for flaky operations
  • JSON Schema / contract testing utilities
  • Soft assertions to collect multiple failures
  • Use cases include validating REST and GraphQL responses, building resilient test suites, and enforcing contracts across services.

Quick Start

Run a starter test that uses HTTPClient, ResponseValidator, and DataGenerator to call a sample endpoint.

Frequently Asked Questions about api-testing-patterns

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

FAQPage Schema
How do I validate API responses with Pydantic schemas in pytest?

API response validation with Pydantic is handled by a ResponseValidator wrapper that parses HTTP response payloads and asserts them against your model definitions. This Skill provides that utility to automate schema enforcement in pytest.

What's the best way to handle retries and polling in API test automation?

The best way to handle retries and polling in API test automation is combining a Waiter utility for polling logic with a retry decorator for flaky operations. This Skill provides both to improve test reliability without manual sleep management.

How do I generate realistic test data for REST and GraphQL API testing?

You generate realistic test data for REST and GraphQL API testing by using a Faker-based DataGenerator factory. This Skill includes that component to produce varied, realistic inputs for your HTTP client requests automatically.

Can I use httpx for building HTTP clients in my API test suite?

Yes, you can use httpx for building HTTP clients in your API test suite. This Skill provides an HTTPClient wrapper that integrates logging and test utilities, designed for testing both REST and GraphQL APIs.

How does contract testing work with JSON Schema validation?

Contract testing with JSON Schema validation works by asserting that API responses conform to predefined structural contracts. This Skill includes contract testing utilities that enforce consistency across services by validating response structures against schemas.

Why do my API tests fail silently without collecting all assertion errors?

API tests fail silently without collecting all assertion errors because standard assertions halt execution on the first failure. This Skill provides soft assertions to collect multiple failures, giving you a complete picture of response validation issues.