pytest-suite

pytest-suite is a skill for Claude Code from vstorm-co/full-stack-ai-agent-template. It costs 59 tokens per session (629 once invoked), scanned A, original, MIT.

A project-specific guide for writing backend tests with pytest, a Python testing tool, and anyio, a library for testing asynchronous code.

In plain words
What is it for?
It helps add or extend tests for backend services, API routes, and repositories, including cases where code coverage is missing.
Why use it?
It provides the repository's established test setup, including fake database sessions and HTTP requests, so tests can run without a real database.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

About the project

Full-Stack AI Agent Template generates full-stack AI applications with a FastAPI backend and Next.js frontend, including agents, retrieval-augmented generation, streaming, authentication, and integrations. It is for building AI products with features such as chat, conversation sharing, administration, and multiple agent or vector-database choices. Catalogue add-ons support the generated applications and their agent workflows.

vstorm-co/full-stack-ai-agent-template · 1,879 stars · on GitHub · vstorm-co.github.io

Install

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.

agentmods
npx agentmods add skills/vstorm-co/full-stack-ai-agent-template/pytest-suite
Any agent
npx skills add vstorm-co/full-stack-ai-agent-template --skill pytest-suite
Clone the repo
git clone --depth 1 https://github.com/vstorm-co/full-stack-ai-agent-template

Made for: Claude Code.

Wrote 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.

agentmods badge for pytest-suite

README.md
[![agentmods](https://agentmods.dev/badge/skills/vstorm-co/full-stack-ai-agent-template/pytest-suite.svg)](https://agentmods.dev/skills/vstorm-co/full-stack-ai-agent-template/pytest-suite)
Your own site
<a href="https://agentmods.dev/skills/vstorm-co/full-stack-ai-agent-template/pytest-suite"><img src="https://agentmods.dev/badge/skills/vstorm-co/full-stack-ai-agent-template/pytest-suite.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 629 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.00629
Opus 5 $0.00030 $0.00315
Sonnet 5 $0.00012 $0.00126
Haiku 4.5 $0.00006 $0.00063

Measured 6d ago against content hash d61d0088f071, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pytest-suite scanned grade A with 0 findings 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 6d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

template/{{cookiecutter.project_slug}}/.claude/skills/pytest-suite/SKILL.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Backend Tests (pytest + anyio)

Tests live in backend/tests/, mirror the source layout (app/services/user.pytests/services/test_user.py), and run with no real databaseconftest.py overrides get_db_session with an AsyncMock via FastAPI dependency_overrides.

Key fixtures (tests/conftest.py)

  • clienthttpx.AsyncClient over ASGITransport(app=app) (use this, not Starlette TestClient)
  • mock_db_sessionAsyncMock standing in for AsyncSession
  • mock_redis (when Redis is enabled), api_key_headers (when API keys are enabled)

Patterns

Async tests use anyio, not @pytest.mark.asyncio:

import pytest

pytestmark = pytest.mark.anyio  # at module top, or mark per-test

Service test — stub what the repo/session returns, assert behavior + exceptions:

async def test_get_user_not_found_raises(monkeypatch, mock_db_session):
    service = UserService(mock_db_session)
    monkeypatch.setattr(user_repo, "get_by_id", AsyncMock(return_value=None))
    with pytest.raises(NotFoundError):
        await service.get_by_id(UUID("00000000-0000-0000-0000-000000000000"))

API test — drive the route through client, override auth deps with a mock user:

async def test_create_user_returns_201(client: AsyncClient):
    app.dependency_overrides[get_current_user] = lambda: mock_user
    resp = await client.post("/api/v1/users", json={"email": "[email protected]", "password": "secret123"})
    assert resp.status_code == 201

Naming & rules

  • test_<action>_<scenario>_<expected_result> (e.g. test_create_user_with_duplicate_email_raises_already_exists_error)
  • One behavior per test; plain assert (pytest rewrites it)
  • Use factory fixtures for data, not raw dicts; each test independent
  • Clear app.dependency_overrides after the test (the client fixture already does this for the DB/Redis overrides)

Run

cd backend && uv run pytest                 # all
uv run pytest tests/services/test_user.py -v
uv run pytest --cov=app                      # coverage

Read the full file on GitHub · 58 lines

Changes

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.

  1. 6d ago First seen · 58 lines · 59 tokens per session scan A d61d0088f071

Subscribe to this mod's changes

pytest-suite is a skill published in the GitHub repository vstorm-co/full-stack-ai-agent-template (1,879 stars, last pushed 2d ago), licensed MIT. It adds 59 tokens to every session and 629 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

python-testing

Write or modify Python tests. Use when: adding new tests, understanding testing conventions, working with fixtures, writing FastAPI route tests, database tests, or following pytest patterns. DO NOT USE FOR RUNNING TESTS. If you are just running tests, not building them, you do not need this.

tedivm/robs_awesome_python_template · 64 tokens

debug

Structured bug diagnosis and fixing workflow that reproduces, diagnoses root cause, applies a minimal fix, writes regression tests, and scans for similar patterns.

first-fluke/fullstack-starter · 30 tokens

代码调试

调试工作流:确认需要 → 先写失败测试复现 → 定位根因 → 修复 → 回归。含修复熔断机制(同模块 bug 打回超 3 次停止)、逐层根因分析(5 Whys)、假设管理、鱼骨图。用于 Bug 修复、测试失败、运行时错误排查。.

jianchen08/Agent-os-open · 82 tokens

代码实现

编码工作流:确认需要 → 模块边界设计 → TDD 红绿循环(写失败测试、实现、重构、回归)→ 风险分级。用于新功能开发、代码修改、重构、补测试。.

jianchen08/Agent-os-open · 54 tokens

测试基础设施

提供端到端测试所需的基础能力脚本,包括日志拦截提取、数据库快照对比、副作用 mock 和验证。.

jianchen08/Agent-os-open · 35 tokens

创建工具

创建或修改工具时加载。内置工具创建规范:TDD 流程、命名规范、BuiltinTool 继承、ToolCategory 枚举、路径规范、代码模板要点。.

jianchen08/Agent-os-open · 46 tokens