agentsclimarketplace

Testing python

Skill qte77/claude-code-plugins/plugins/python-dev/skills/testing-python

A Claude Code plugin marketplace providing skills, rules, and scripts extracted from a production development workflow.

Install
npx -y skills add qte77/claude-code-plugins --skill testing-python

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Writes tests following TDD Red-Green-Refactor (pytest + Hypothesis). Tests behavior, not implementation. Use when writing unit tests, integration tests, or property tests.

SKILL.md

3.0 KB, as published. Nobody here has run it

Python Testing

Target: $ARGUMENTS

Writes focused, behavior-driven tests following project testing strategy.

Quick Reference

TDD methodology (language-agnostic): See tdd-core plugin (testing-tdd skill)

Python-specific documentation: references/

  • references/testing-strategy.md - Python tools (pytest, Hypothesis, inline-snapshot)
  • references/tdd-best-practices.md - Python TDD examples (extends tdd-core)

Approach

TDD only: pytest for known cases, Hypothesis for edge cases, inline-snapshot for regression. Tests assert observable behavior — inputs produce expected outputs/side-effects. No Gherkin, no feature files, no step definitions.

See references/testing-strategy.md for tool selection guide.

TDD Essentials (Quick Reference)

Cycle: RED (failing test) → GREEN (minimal pass) → REFACTOR (clean up)

Structure: Arrange-Act-Assert (AAA)

def test_order_processor_calculates_total():
    # ARRANGE
    items = [Item(price=10.00, qty=2), Item(price=5.00, qty=1)]
    processor = OrderProcessor()

    # ACT
    total = processor.calculate_total(items)

    # ASSERT
    assert total == 25.00

Hypothesis Priorities (Edge Cases within TDD)

PriorityAreaExample
CRITICALMath formulasScores always in bounds
CRITICALLoop terminationNever hangs
HIGHInput validationHandles any text
HIGHSerializationAlways valid JSON

What to Test (KISS/DRY/YAGNI)

High-Value: Business logic, integration points, edge cases, contracts

Avoid: Library behavior, trivial assertions, implementation details, default constants, stale fixture patches (see references/testing-strategy.md → "Patterns to Remove")

See references/testing-strategy.md → "Patterns to Remove" for full list.

Naming Convention

Format: test_{module}_{component}_{behavior}

test_user_service_creates_new_user()
test_order_processor_validates_items()

Execution

make test              # All tests
make test_rerun        # Rerun failed tests (fast iteration)
make validate          # Full pre-commit validation
pytest tests/ -v       # Verbose
pytest -k test_user_   # Filter by name

Quality Gates

  • All tests pass (make test)
  • TDD Red-Green-Refactor followed
  • Arrange-Act-Assert structure used
  • Naming convention followed
  • Behavior-focused (not implementation)
  • No library behavior tested
  • Mocks for third-party types use spec=RealClass

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.