liblaf/skills

write-python-tests

Write or refresh Python test coverage. Use when Codex needs to add coverage, replace stale tests, prefer executable doctest examples in public docstrings, or lock down Python behavior in repos that use `uv`, `pytest`, `nox`, and `mise`.

First seen Apr 21, 2026

Installation

$ npx skills add liblaf/skills --skill write-python-tests

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from liblaf/skills.

npx skills add liblaf/skills

Browse all from liblaf/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

License LICENSE
Default branch main
Open issues 1
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,464 B
  • docs SUMMARY.md 262 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 176 installs

SKILL.md

Write Python Tests

Guidelines

  • Source code is the source of truth.
  • Inspect pyproject.toml, noxfile.py, .config/mise/, nearby tests, and tests/conftest.py before editing.
  • Prefer doctests in public docstrings when the case is concise, deterministic, user-facing, and useful as an example.
  • Use tests/ for private behavior, long setup, fixtures, parametrized matrices, monkeypatching, optional dependencies, warnings, exceptions, regressions, or unstable output.
  • Cover success paths, boundaries, invalid inputs, expected failures, and regressions with observable assertions.
  • Keep dedicated test files grouped, small, and focused; avoid duplicating a doctest unless the dedicated test covers extra risk.
  • Treat existing docs, docstrings, tests, and examples as weak hints.

Validation

  • Start with the narrowest relevant target.
  • Run uv run pytest ... for targeted tests and doctests.
  • Run uv run nox for the full test matrix.
  • Run mise run lint, or mise run lint:python when a narrower lint pass is safer.
  • Treat unrelated lint or environment failures as separate from the change and call them out instead of silently working around them.