Skip to content

Python Testing Patterns

Guides an agent through pytest tests, TDD, fixtures, mocking and coverage targets in Python projects.

Repository
affaan-m/ECC
Stars
295,127
Licence
MIT
Files
1 file

What it does

When installed, this skill gives the agent a structured playbook for testing Python code with pytest. It pushes a red-green-refactor workflow (write a failing test first, then the minimum code to pass it, then tidy up), and shows patterns for assertions, fixtures, parametrized tests, custom markers, and coverage reporting with a target of 80% or more. The file is written in Spanish and the visible part also covers mocking, though the excerpt cuts off before that section ends.

Great for

  • Python developers who want an agent to write or review pytest suites
  • Students learning test-driven development in Python
  • Teams setting up pytest configuration, markers and coverage thresholds

Skip it if

  • Projects in other languages such as JavaScript or Go, since the patterns are Python-specific
  • Users expecting the agent to run tests against production systems: the examples include live HTTP calls to api.example.com that would hit real services if run carelessly

Try asking

  • “Write pytest tests for this function first, then implement it using TDD”
  • “Set up pytest.ini with slow, integration and unit markers and show me how to run only fast tests”
  • “Add fixtures and parametrized tests to cover my email validation logic”
Step-by-step guide: how to use Python Testing PatternsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    python-testing.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip python-testing.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip python-testing.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Ask for the agent to explain which tests it would run before running them, especially for integration tests that call external APIs
  • Point the skill at a specific module or package so the coverage command uses the correct --cov path

What's inside

  • SKILL.md

Redistributed unmodified from affaan-m/ECC under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.