Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/aks-builds/quality-skills/pytest-apinpx skills add aks-builds/quality-skills --skill pytest-apigit clone --depth 1 https://github.com/aks-builds/quality-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/aks-builds/quality-skills/pytest-api)<a href="https://agentmods.dev/skills/aks-builds/quality-skills/pytest-api"><img src="https://agentmods.dev/badge/skills/aks-builds/quality-skills/pytest-api.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00114 | $0.02668 |
| Opus 5 | $0.00057 | $0.01334 |
| Sonnet 5 | $0.00023 | $0.00534 |
| Haiku 4.5 | $0.00011 | $0.00267 |
Grade A, and why
pytest-api scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
resp = requests.post( How it starts
The opening of the file, as written. The whole thing — 304 lines — stays where its author put it; the contents beside it link to each section on GitHub.
pytest API Testing
You are an expert in API testing with Python + pytest + requests / httpx. Your goal is to help engineers write maintainable, fast pytest suites for REST (and JSON-RPC, gRPC-over-REST gateways, etc.) — without fabricating fixture signatures, library APIs, or pytest plugin names. When uncertain, point the reader to docs.pytest.org, docs.python-requests.org, or python-httpx.org.
Initial Assessment
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
- HTTP client —
requests(sync, by far the most common),httpx(sync + async), or the framework's test client (e.g., FastAPI'sTestClient, Django'sClient). - Sync vs async — if the system under test is async (FastAPI / Starlette / aiohttp),
httpx.AsyncClientis the natural fit. - Pytest plugins in use —
pytest-xdist(parallel),pytest-asyncio(async),pytest-httpx/responses(mocking),pytest-vcr(cassettes),schemathesis(property-based / OpenAPI-driven). - Auth model — Bearer / Basic / OAuth / cookies / mTLS. Affects fixture design.
- Target environment — local in-process (TestClient), local server (compose), or remote (staging URL).
If the file does not exist, ask: HTTP client choice, sync or async, in-process or against a server, target framework, and any pytest plugins already standardized.
Why pytest + requests/httpx
- First-class fixtures — declarative, scoped, composable. Setup once, reuse everywhere.
- Parametrization — boundary cases and data-driven tests are trivial (
@pytest.mark.parametrize). - Parallel execution —
pytest-xdistfor free CPU scaling. - Rich ecosystem — assertion plugins, reporters, OpenAPI integration, property-based testing via
hypothesis/schemathesis. - Pythonic — refactors, types (with mypy), IDE support all work.
When not to use pytest:
- Non-Python stack with no Python expertise → use the language-native option.
- Pure Postman/QA-led workflows → postman-newman.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 304 lines · 114 tokens per session scan A 98a1eb228c23
pytest-api is a skill published in the GitHub repository aks-builds/quality-skills (2 stars, last pushed 2d ago), licensed MIT. It adds 114 tokens to every session and 2,668 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
defect-analyzer
Use when someone asks to analyze a defect report, analyze bug data, perform defect metrics analysis, review a defect log, or upload a defect file for quality insights.
test-case-writer
Use when someone asks to generate test cases, write test cases from a user story, create test cases from a BRD, design test cases from a mockup or wireframe, or produce a test case table from requirements.
automated-e2e-testing
将手动测试用例转为 Playwright E2E 测试并执行时使用;含写自动化前的业务熟悉踩点、Page Object/Helper 编写、执行中的 Bug 证据收集与报告条目记录。不用于:纯 API 接口测试(api-testing)、以理解系统为目的的独立探索会话(exploratory-testing)、已确认 Bug 的根因分析(bug-analysis)。.
api-testing
接口级测试时使用——从 OpenAPI/Swagger 文档或用例 Schema 中可自动化的接口用例出发,覆盖参数、边界、鉴权、幂等、并发、错误响应与数据一致性,产出可执行的 API 测试脚本与运行结果;含接口压测承接(k6,类型矩阵轴 1 执行层)。不用于:Web UI 流程(automated-e2e-testing)、手动用例编写(test-case-writing)。.
test-strategy
回答"这个功能应该怎么测"——把风险翻译成两域测试范围与深度。策略位于"需求 → 风险分析 → 策略 → 测试设计 → 用例"链路中,跳过策略直接写用例是本框架明确反对的。.
regression-testing
代码变更(diff/Bug 修复/需求变更)后判断应回归哪些测试时使用——沿"改动文件 → 改动函数 → 受影响功能 → 受影响用例"分析链,基于用例 Schema 的追溯映射产出分级回归清单。不用于:用例文件本身的增量修改(test-case-writing)、长期回归策略(test-strategy)。.