testing-py

Installation
SKILL.md

Testing Python

A green suite is not a tested suite. Most Python suites pass while shipping bugs because they lie in four predictable ways, and your job is to refuse each lie:

  1. Line-only coverage reports 95% while every else and except arm is unvisited.
  2. Mocks patched at the wrong place never apply, so the test runs the real code or asserts nothing.
  3. autospec-less mocks pass even when you typo a method name or change a signature — a false green.
  4. autouse fixtures mutate hidden global state, so tests pass alone and fail in CI order.

The posture, non-negotiable: pytest 9 strict markers and strict config on, branch coverage on, autospec= on every mock, and Hypothesis property tests for any pure logic with an invariant. Assert on behavior, never on a mock's internals.

Versions you are on (2026-06): pytest 9.0.2, coverage.py 7.14.1, pytest-cov 7.x (needs coverage ≥ 7.10.6), Hypothesis 6.155.x.

Which test do I need?

Pick the cheapest test that still catches the bug.

Installs
3
GitHub Stars
116
First Seen
Aug 6, 2026
testing-py — ericrisco/rsc-harness