CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

python-testing-patterns

This guide explains how to design and implement Python tests with pytest, including unit, integration, async, parameterized, property-based, and database tests. It provides examples for fixtures, mocks, error paths, coverage, and CI workflows, along with principles for test organization and maintainability. Use it when building test suites, improving test quality, or diagnosing failing tests.

Quality

69%

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

Fix and improve this skill with Tessl

tessl review fix ./tests/ext_conformance/artifacts/agents-wshobson/python-development/skills/python-testing-patterns/SKILL.md
SKILL.md
Quality
Evals
Security

Quality

Content

50%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.

The body is well-organized and rich with executable pytest examples, but it functions as a general pytest tutorial rather than a skill adding non-obvious value: nearly all patterns are standard knowledge Claude already has, everything is inlined in one monolithic file, and no sequenced workflow or validation guidance ties the patterns together.

Suggestions

Drastically trim basic pytest material (Calculator examples, AAA pattern explanation, simple fixtures/parametrize/mock boilerplate) and keep only patterns Claude would not infer on its own — e.g., the retry side_effect pattern, freezegun time travel, and the parametrized db_backend fixture.

Split advanced material into one-level-deep bundle files (e.g., references/mocking.md, references/database-testing.md, references/ci-configuration.md) and keep SKILL.md as a concise overview that links to them.

Add a short sequenced workflow for the main use case — set up pytest config, create conftest fixtures, write focused tests (one behavior per test), run with coverage, wire into CI — with an explicit verification step such as running the suite and checking coverage before proceeding.

DimensionReasoningScore

Conciseness

The ~1,050-line body is a pytest tutorial covering concepts Claude already knows — basic Calculator tests, the AAA pattern, simple fixtures, parametrize, unittest.mock basics, tmp_path, and monkeypatch — heavily padded with redundant example code. A few sections add genuine value (retry side_effect patterns, freezegun time control, team naming conventions), keeping it above anchor 1's uniformly padded content.

2 / 5

Actionability

Most guidance is executable and copy-paste ready: complete pytest examples, coverage commands, pytest.ini/pyproject.toml configs, and a CI workflow. It misses anchor 5 because several fragments reference undefined objects ('service', 'ServiceWithRetry', 'create_token', 'Token', 'data') and 'test_addition_parameterized' imports from 'test_calculator', so not every example is runnable as written.

4 / 5

Workflow Clarity

The skill is a pattern catalog with a topical progression (Quick Start → fundamentals → advanced → best practices → CI) but no sequenced workflow for arriving at a working test suite (e.g., configure → conftest → write tests → run → CI) and no validation checkpoints. This matches anchor 3: sequence/structure present but checkpoints missing or implicit.

3 / 5

Progressive Disclosure

Section headers are clear, so structure is better than anchor 2's minimal organization, but no bundle files exist and everything — advanced mocking, database testing, property-based testing, CI, and config reference — is inlined in a single 1,000+ line SKILL.md. This matches anchor 3: some structure, but content that should live in separate reference files is inline.

3 / 5

Total

12

/

20

Passed

Description

75%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 solid description that follows the what-plus-when pattern with an explicit 'Use when' clause, third-person-style phrasing, and named tools (pytest, fixtures, mocking, TDD). Its weaknesses are generic action verbs, mildly circular trigger phrasing ('implementing testing best practices'), and missing common trigger terms like unit/integration tests and test coverage.

DimensionReasoningScore

Specificity

The description names the domain and several concrete capabilities — 'pytest, fixtures, mocking, and test-driven development' — matching the anchor for several specific items with minor gaps. It falls short of anchor 5 because the action verb is generic ('Implement comprehensive testing strategies') rather than a list of distinct concrete actions.

4 / 5

Completeness

Both 'what' (implement testing strategies with pytest, fixtures, mocking, TDD) and an explicit 'when' ('Use when writing Python tests, setting up test suites, or implementing testing best practices') are present. It misses anchor 5 because the 'when' triggers are less concrete — 'implementing testing best practices' is circular and vague compared to the anchor's fully specific trigger phrases.

4 / 5

Trigger Term Quality

Natural user phrases like 'writing Python tests' and 'setting up test suites' are present, giving good keyword coverage. It is not anchor 5 because common natural terms are missing — 'unit tests', 'integration tests', 'test coverage', 'debug failing tests'.

4 / 5

Distinctiveness Conflict Risk

The Python-testing/pytest niche is mostly distinct with pytest, fixtures, and mocking as differentiating triggers. It is not anchor 5 because 'testing best practices' is broad and could overlap with general testing or code-review skills.

4 / 5

Total

16

/

20

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.

Validation — 15 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

skill_md_line_count

SKILL.md is long (1051 lines); consider splitting into references/ and linking

Warning

Total

15

/

16

Passed

Repository

Dicklesworthstone/pi_agent_rust

Path

tests/ext_conformance/artifacts/agents-wshobson/python-development/skills/python-testing-patterns/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.