litestar-testing

litestar-testing is a skill for Claude Code from litestar-org/litestar-skills. It costs 53 tokens per session (8,137 once invoked), scanned A, original, MIT.

A set of testing instructions for Litestar, a Python web framework, using pytest and AnyIO. It covers both normal and asynchronous tests for web handlers and application behavior.

In plain words
What is it for?
Use it to write Litestar tests for requests, forms, files, headers, cookies, dependency injection, guards, application lifespan, and database integration. It is not intended for JavaScript testing or generic pytest guidance.
Why use it?
It helps avoid uncertainty when choosing test clients, setting up application startup and shutdown, mocking dependencies, and checking web requests. It also keeps asynchronous tests from using conflicting test systems.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the litestar plugin — 20 skills, 1 agent, 1 hook shipped together

Good fit Use it to write Litestar tests for requests, forms, files, headers, cookies, dependency injection, guards, application lifespan, and database integration. It is not intended for JavaScript testing or generic pytest guidance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/litestar-org/litestar-skills/litestar-testing
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.

Any agent
npx skills add litestar-org/litestar-skills --skill litestar-testing
Clone the repo
git clone --depth 1 https://github.com/litestar-org/litestar-skills

Made for: Claude Code.

Or install litestar, the plugin that ships this one along with the rest of its 20 skills, 1 agent, 1 hook.

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 litestar-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/litestar-org/litestar-skills/litestar-testing/github.svg)](https://agentmods.dev/skills/litestar-org/litestar-skills/litestar-testing)
Your own site
<a href="https://agentmods.dev/skills/litestar-org/litestar-skills/litestar-testing"><img src="https://agentmods.dev/badge/skills/litestar-org/litestar-skills/litestar-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for litestar-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/litestar-org/litestar-skills/litestar-testing"><img src="https://agentmods.dev/badge/skills/litestar-org/litestar-skills/litestar-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,137 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00053 $0.08137
Opus 5.5 $0.00021 $0.03255
Sonnet 5.5 $0.00011 $0.01627
Haiku 4.5 $0.00005 $0.00814

Measured 5d ago against content hash 0be284e718a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

litestar-testing 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 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.

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.

plugins/litestar/skills/litestar-testing/SKILL.md · 779 lines

How it starts

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

litestar-testing

Litestar-specific testing patterns built on pytest + anyio. Covers:

  • TestClient vs AsyncTestClient — constructor options, lifespan, and when to use each
  • create_test_client and create_async_test_client — inline app factories for isolated handler/controller tests
  • @pytest.mark.anyio setup and pytest-asyncio coexistence rules
  • App + lifespan fixtures (on_startup / on_shutdown / lifespan)
  • Mocking Guards and overriding DI dependencies (native Provide and Dishka Provider)
  • Session testing with set_session_data and get_session_data
  • WebSocket testing with websocket_connect and WebSocketTestSession
  • Unit-testing Guards and dependencies with RequestFactory
  • Live server subprocess testing with subprocess_async_client and subprocess_sync_client
  • Integration with pytest-databases (see ../pytest-databases/SKILL.md) and polyfactory (see ../polyfactory/SKILL.md)
  • Autowire discovery and cache isolation (see ../litestar-autowire/references/testing.md)

For JS-side testing (Vitest, Testing Library, Playwright), use the upstream Vitest docs and Litestar's own JS examples. Out of scope here.

Code Style Rules

  • PEP 604 unions: T | None, never Optional[T]
  • Test modules MAY use from __future__ import annotations — they are pure consumer code.
  • Function-based tests (not class-based)
  • One assertion concern per test
  • Async Litestar tests use @pytest.mark.anyio by default; do not mix AnyIO and pytest-asyncio auto modes.
  • Prefer AsyncTestClient for new code; TestClient only for legacy / sync-only flows.
  • Always enter test clients as context managers (async with AsyncTestClient(...) / with TestClient(...)) — implicit lifespan startup without a context manager emits DeprecationWarning and is removed in Litestar 3.0.

Quick Reference

TestClient vs AsyncTestClient

Client Base Class Context Manager Session Helpers WebSocket Connect
AsyncTestClient httpx.AsyncClient, BaseTestClient async with AsyncTestClient(app=app) as client: await client.set_session_data(...) / await client.get_session_data() with await client.websocket_connect("/ws") as ws:
TestClient httpx.Client, BaseTestClient with TestClient(app=app) as client: client.set_session_data(...) / client.get_session_data() with client.websocket_connect("/ws") as ws:

Read the full file on GitHub · 779 lines

Files

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.

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. 5d ago Changed · +22 lines 0be284e718a9
  2. 21d ago Changed · +62 lines · -3 tokens per session a167008609e3
  3. 29d ago Changed · +204 lines 75bb5a1ce0c0
  4. 1mo ago First seen · 491 lines · 56 tokens per session scan A 33b35d40111d

Subscribe to this mod's changes

litestar-testing is a skill published in the GitHub repository litestar-org/litestar-skills (16 stars, last pushed 5d ago), licensed MIT. It adds 53 tokens to every session and 8,137 once invoked, about $0.0002 per session on Opus 5.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

craft-pest

Testing Craft CMS 5 plugins and modules with Pest — test isolation, database safety, and the markhuot/craft-pest-core harness. ALWAYS load when writing, running, fixing, or reviewing tests for a Craft plugin or module, and whenever a suite touches a real Craft install. Covers why rollback is opt-in, tests/Pest.php +…

michtio/craftcms-claude-skills · 175 tokens

Unit Test Scaffold (Python/pytest)

Generate Python/pytest unit test skeletons from specifications.

s977043/river-review · 19 tokens

python-testing

Python testing patterns with pytest including unit tests, integration tests, fixtures, mocking, and coverage. Use when writing Python tests.

DmitriyYukhanov/claude-plugins · 28 tokens

python-testing

Python test authoring and review with pytest. Use when writing, adding, generating, or reviewing Python tests or unit tests for a function, module, or class; running pytest or a single test (the -k flag and other invocation flags for a Makefile or CI); parametrizing test cases into the table-driven pattern; setting up…

bitwise-media-group/skills · 178 tokens

testing-python

Writes tests following TDD Red-Green-Refactor (pytest + Hypothesis). Tests behavior, not implementation. Use when writing unit tests, integration tests, or property tests.

qte77/claude-code-plugins · 39 tokens

no-silent-pass

Write Python whose failures are visible and checks that actually fire — distinct sentinels for success and error, filters that narrow to nothing without reading as "all clear", output never discarded on a non-zero exit, and selftest cases proven red before they are trusted (mutate the fix, mutate it the other way too…

AleksandarBisevac/claude-plugins · 143 tokens