CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

testland/pytest-asyncio-patterns

Use for any question or task about testing async Python code, including how to test an async function, async tests that are skipped or fail with event-loop errors, and tests for FastAPI or aiohttp endpoints: pytest-asyncio modes and loop scopes, async fixtures, AsyncMock (assert_awaited), httpx.AsyncClient with ASGITransport and aiohttp_client.

1.01x
Quality

91%

Does it follow best practices?

Impact

97%

1.01x

Average score across 10 eval scenarios

SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

Quality

Content

86%Weight 40%Scale 1-5

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

A high-quality skill body: fully executable examples, a clean step sequence, real error-recovery guidance via the anti-patterns table, and exemplary progressive disclosure into two well-formed reference files. Minor deductions for repeating the strict/auto fixture rule three times and lacking an explicit end-to-end validation checkpoint.

Suggestions

State the strict-mode fixture-decorator rule once (the Step 2 mode table) and have Step 5 and the Anti-patterns table reference it rather than restate it.

Add an explicit validation step after Step 3 (e.g., 'run pytest -q and confirm async tests pass and are not skipped') to close the feedback loop between configuration and outcome.

Mention 'stdlib since Python 3.8' once at first use instead of repeating it in Step 6, the Anti-patterns table, and the reference file.

DimensionReasoningScore

Conciseness

Overall lean and free of beginner explanations, but the strict/auto fixture-decorator rule is stated three times (Step 2 table "Async fixtures must use @pytest_asyncio.fixture", Step 5 prose repeating it, and again in the Anti-patterns table), and "stdlib since Python 3.8" recurs multiple times. These are minor instances of over-explanation/repetition that could be trimmed, matching the anchor-4 example rather than the every-token-earns-its-place anchor.

4 / 5

Actionability

Fully executable throughout: pip install commands, pyproject.toml config, marked tests, module-level pytestmark, loop_scope usage, async fixtures with yield teardown, an AsyncMock example with assert_awaited_once_with, and a complete FastAPI ASGITransport test. Code is copy-paste ready and covers the common cases, matching the anchor-5 example.

5 / 5

Workflow Clarity

Steps 1-7 are clearly sequenced (Install → Choose mode → Mark → Scope → Fixtures → Mock → Framework clients) with one explicit verification checkpoint ("pytest --co -q # should show no PytestUnraisableExceptionWarning") and an anti-patterns table mapping concrete errors ("attached to a different loop", TypeError) to fixes. However, there is no explicit run-and-confirm validation loop (e.g., 'run pytest and confirm tests execute rather than skip'), so it sits between the minor-validation-gaps anchor and the full feedback-loop anchor.

4 / 5

Progressive Disclosure

The spine keeps one primary example per topic inline and defers exhaustive detail to two real, well-organized, one-level-deep files, clearly signaled with descriptive text ("Patching an async import path (new_callable=AsyncMock), the full await-assertion table...: references/asyncmock-assertions.md"). Both referenced files exist, contain no nested references, and split content appropriately — matching the clear-overview anchor.

5 / 5

Total

18

/

20

Passed

Description

92%Weight 40%Scale 1-5

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

A strong description: explicit 'Use for...' trigger guidance, concrete symptom-based triggers (skipped tests, event-loop errors), and tool-level specificity. The only gap is a few high-frequency natural terms (coroutine, await) that users commonly paste in error messages.

Suggestions

Add 'coroutine' (e.g., 'coroutine was never awaited') to the trigger phrasing, since that error message is one of the most common reasons a user reaches for this skill.

DimensionReasoningScore

Specificity

Lists multiple concrete capabilities down to API level — "pytest-asyncio modes and loop scopes, async fixtures, AsyncMock (assert_awaited), httpx.AsyncClient with ASGITransport and aiohttp_client" — plus concrete failure modes like "async tests that are skipped or fail with event-loop errors". This matches the anchor for comprehensive, specific concrete actions; nothing is vague or padded.

5 / 5

Completeness

Explicitly answers both: the what ("pytest-asyncio modes and loop scopes, async fixtures, AsyncMock (assert_awaited), httpx.AsyncClient with ASGITransport and aiohttp_client") and the when ("Use for any question or task about testing async Python code, including...") with concrete trigger phrases. This mirrors the anchor-5 example structure of capabilities followed by an explicit use-when clause.

5 / 5

Trigger Term Quality

Natural user phrasings are well covered ("how to test an async function", "async tests that are skipped or fail with event-loop errors", "FastAPI or aiohttp endpoints"), matching good keyword coverage. It falls short of the comprehensive anchor because common terms users paste are missing, notably "coroutine" (as in 'coroutine was never awaited'), "await", and "trio".

4 / 5

Distinctiveness Conflict Risk

The niche is unambiguous — async-specific testing with named tools (pytest-asyncio, AsyncMock, ASGITransport, aiohttp_client) — so a generic pytest or sync-testing question would not trigger it. Clear niche with distinct triggers and minimal conflict risk.

5 / 5

Total

19

/

20

Passed

Validation

100%

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

Validation — 16 / 16 Passed

Validation for skill structure

No warnings or errors.

Reviewed

On this page