CtrlK
BlogDocsLog inGet started
Tessl Logo

testland/pytest-asyncio-patterns

Configures and runs async Python tests with pytest-asyncio: installs the plugin, selects asyncio_mode (auto vs strict), scopes event loops (function/class/module/session), writes async fixtures with @pytest_asyncio.fixture, mocks coroutines with AsyncMock, and tests FastAPI (httpx.AsyncClient + ASGITransport) and aiohttp (aiohttp_client fixture) applications. Use when a Python project contains async def test_ functions, FastAPI/aiohttp endpoints, or any asyncio-based code that needs pytest integration. Do NOT use for general pytest fixture design, parametrize patterns, or conftest.py structure without an asyncio-specific problem (event-loop scoping, mode config, AsyncMock, ASGI client): use pytest-tests for those.

79

Quality

99%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

Quality

Content

100%

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

The body is lean, actionable, and well-structured as a 7-step workflow with a verification checkpoint, supported by two real one-level-deep reference files that hold the details the spine defers. It balances token efficiency with copy-paste-ready code and clear navigation.

DimensionReasoningScore

Conciseness

Lean and efficient throughout: it assumes Claude's competence (no "what is asyncio" preamble) and jumps to install/mode/scoping/fixtures with executable snippets, where the only explanatory prose states non-obvious gotchas like "coroutine tests are collected but never awaited".

3 / 3

Actionability

Every section gives fully executable, copy-paste-ready guidance: pip installs, pyproject.toml blocks, pytestmark usage, loop_scope decorators, AsyncMock with assert_awaited_once_with, and an httpx AsyncClient + ASGITransport example.

3 / 3

Workflow Clarity

A clearly sequenced 7-step process (Install -> mode -> mark -> scope -> fixtures -> mock -> framework clients) with an explicit verification checkpoint in Step 1 ("pytest --co -q") and an anti-patterns/Limitations section for error recovery.

3 / 3

Progressive Disclosure

The spine is an overview with well-signaled one-level-deep references to real files (references/asyncmock-assertions.md and references/framework-clients.md) that contain exactly the promised content with no nested references, plus a curated external-docs References section.

3 / 3

Total

12

/

12

Passed

Description

100%

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

The description is specific, trigger-rich, and fully answers both what and when in third person, with an explicit exclusion clause to avoid overlap with the general pytest-tests skill. It is a strong, concise description with no significant weaknesses.

DimensionReasoningScore

Specificity

Lists multiple concrete actions ("installs the plugin", "selects asyncio_mode (auto vs strict)", "scopes event loops (function/class/module/session)", "writes async fixtures with @pytest_asyncio.fixture", "mocks coroutines with AsyncMock", "tests FastAPI ... and aiohttp"), matching the score-3 anchor.

3 / 3

Completeness

Explicitly answers both what (the enumerated action list) and when ("Use when a Python project contains async def test_ functions, FastAPI/aiohttp endpoints, or any asyncio-based code"), plus an explicit "Do NOT use" exclusion clause.

3 / 3

Trigger Term Quality

Uses natural terms a user would say ("async Python tests", "pytest-asyncio", "FastAPI/aiohttp endpoints", "asyncio-based code", "async def test_ functions") with good coverage of the niche's common phrasings.

3 / 3

Distinctiveness Conflict Risk

A clear asyncio-specific niche with distinct triggers and an explicit conflict-avoidance clause naming pytest-tests as the alternative for non-async pytest patterns, making wrong-skill triggering unlikely.

3 / 3

Total

12

/

12

Passed

Validation

93%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation15 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

metadata_version

'metadata.version' is missing

Warning

Total

15

/

16

Passed

Reviewed

Table of Contents