CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

python-testing

使用pytest的Python测试策略,包括TDD方法、夹具、模拟、参数化和覆盖率要求。

Quality

70%

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 ./docs/zh-CN/skills/python-testing/SKILL.md
SKILL.md
Quality
Evals
Security

Quality

Content

63%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 an exhaustive, highly executable pytest cookbook whose code examples are its main strength. Its weaknesses are token efficiency — hundreds of lines re-teach pytest basics Claude already knows — and a total lack of file-based disclosure: an ~815-line monolith that should be an overview plus reference files.

Suggestions

Cut the sections that re-teach pytest basics (basic assertions like 'assert result == expected', trivial tests like 'assert 2 + 2 == 4', and the elementary run commands such as 'pytest -v') — keep only the non-obvious patterns (conftest sharing, autospec, PropertyMock, async fixtures).

Split the pattern catalog (mocking, async, database/API testing, config samples) into references/ files (e.g. references/mocking.md, references/async.md) and keep SKILL.md as a short overview with one-level-deep pointers, per the quick-reference table.

Add a validation feedback loop for the coverage requirement: what to do when coverage is below 80% (which files/paths to inspect via --cov-report=term-missing, then re-run).

DimensionReasoningScore

Conciseness

The ~815-line body devotes large sections to fundamentals Claude already knows — "Equality / assert result == expected", "test_addition: assert 2 + 2 == 4", basic fixture setup/teardown, and "Run with verbose output: pytest -v". This matches the 'noticeably verbose; several unnecessary explanations or padded sections' anchor rather than the mostly-efficient level 3, since the padding is pervasive (basic asserts, basic parametrize, basic run commands) rather than occasional.

2 / 5

Actionability

Nearly every section delivers copy-paste-ready code or commands (e.g. "pytest --cov=mypackage --cov-report=term-missing --cov-report=html", "with pytest.raises(ValueError, match=\"invalid input\")", full conftest.py client/auth_headers fixtures), and the examples comprehensively cover the common cases (fixtures, mocking, parametrize, async, exceptions, tmp_path, config). Fits the 'fully executable; covers common cases' anchor; not 4 because gaps are only trivial (a few undefined helper classes like Database, which is normal for pattern docs).

5 / 5

Workflow Clarity

The TDD cycle is an explicit, correctly sequenced workflow ("1. 红… 2. 绿… 3. 重构" with code) and coverage measurement/validation ("目标:80%+… 使用 pytest --cov") provides a checkpoint; the '不要忽略测试失败:所有测试必须通过' do/don't guidance reinforces verification. Fits 'clear sequence with most checkpoints present; minor validation gaps' — e.g. no instruction on what to do when coverage falls below target — so not 5, but validation is far more present than the level-3 anchor.

4 / 5

Progressive Disclosure

No bundle files exist (no references/, scripts/, or assets/), and everything — the full pytest pattern catalog, API-ish quick reference table, and configuration samples — is inlined in one 815-line SKILL.md, i.e. 'content that should be separate is inline'. It scores 3 rather than 2 only because section headers (夹具, 参数化, 模拟和补丁, 测试异步代码…) make the monolith navigable, matching the 'some structure but could be better organized' anchor rather than the header-less wall of text.

3 / 5

Total

14

/

20

Passed

Description

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

The description is specific and distinctive: it names the pytest/Python-testing domain and its four pillars (TDD, fixtures, mocking, coverage) in a concise third-person statement. Its one structural flaw is the complete absence of a 'Use when…' trigger clause, which caps completeness and slightly raises overlap risk.

Suggestions

Append a when-clause, e.g. "Use when writing or reviewing Python tests, setting up pytest, or when the user mentions TDD, test coverage, or mocking" — this would raise completeness from 3 to 5.

Add natural trigger variations such as 'unit tests/单元测试', 'integration tests', and 'test coverage' so users' phrasing matches regardless of wording.

Consider replacing the topic-enumeration ('包括TDD方法、夹具…') with one concrete action verb per pillar (e.g. 'designs fixtures', 'mocks external dependencies') to sharpen specificity.

DimensionReasoningScore

Specificity

"使用pytest的Python测试策略,包括TDD方法、夹具、模拟和覆盖率要求" names the domain and enumerates several concrete components (TDD, fixtures, mocking, coverage requirements), matching 'lists several specific actions; minor gaps'. Not 5 because it names subtopics rather than stating concrete actions (what it actually does with fixtures/mocking), and not 3 because it goes well beyond 1-2 concrete items.

4 / 5

Completeness

The 'what' is clear (a pytest-based Python testing strategy covering TDD, fixtures, mocking, coverage), but there is no 'when' clause at all — no "Use when…" or equivalent trigger guidance — so per the judging guideline a missing 'Use when…' clause caps completeness at 3. This exactly matches the anchor 'has a clear what but when is missing'.

3 / 5

Trigger Term Quality

Natural trigger terms are present — 'pytest', 'Python', 'TDD', '夹具 (fixtures)', '模拟 (mocking)', '覆盖率 (coverage)' — giving good keyword coverage of phrases users would actually say. Not 5 because common variations are missing: no 'unit tests/单元测试', 'integration tests', 'test suite/测试套件', or 'unittest' as a synonym hook.

4 / 5

Distinctiveness Conflict Risk

The pytest/Python-testing niche is clear and the term 'pytest' sharply distinguishes it from generic skills, matching 'mostly distinct; minor overlap risk'. Not 5 because without a when-clause it could also fire for general 'Python quality/开发' requests or a potential unittest-based testing skill; far more distinct than the level-3 'somewhat specific' anchor.

4 / 5

Total

15

/

20

Passed

Validation

87%

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

Validation — 14 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

skill_md_line_count

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

Warning

frontmatter_unknown_keys

Unknown frontmatter key(s) found; consider removing or moving to metadata

Warning

Total

14

/

16

Passed

Repository

affaan-m/ECC

Path

docs/zh-CN/skills/python-testing/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.