Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
bjornmelin avatar

Pytest Dev

  • 10 installs
  • 5 repo stars
  • Updated August 5, 2026
  • bjornmelin/dev-skills

Pytest-dev is a Claude Code skill for writing, refactoring, and speeding up pytest suites and tuning Python test CI.

About

Pytest-dev is a Claude Code skill for Python testing that writes and refactors pytest suites, fixes flakiness, designs fixtures and markers, and speeds up test collection and runtime. A developer uses it for pytest best practices, pytest 9.x features, plugin selection, and CI tuning such as GitHub Actions sharding and xdist parallelism. It ships reference guides and helper scripts for profiling slow tests and splitting suites by historical timings.

  • Writes low-flake pytest suites and designs fixtures, markers, and parametrization
  • Profiles and speeds up test collection and runtime with --durations and xdist
  • Tunes CI with GitHub Actions sharding, parallelism, and JUnit artifacts

Pytest Dev by the numbers

  • 10 all-time installs (skills.sh)
  • Ranked #1,550 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

pytest-dev capabilities & compatibility

Free; uses Python, pytest, and standard plugins.

Capabilities
test authoring · flake fixing · ci tuning
Works with
github
Use cases
testing · ci cd · debugging
IDEs
pycharm · vscode
Pricing
Free
From the docs

What pytest-dev says it does

Produce **high-signal, low-flake, fast** pytest suites and CI configs, with an explicit focus on **measurable wins** (runtime, flake rate, coverage quality).
SKILL.md
Parallelize on one machine (xdist): `python3 -m pytest -n auto --dist load`
SKILL.md
Shard in CI** (split test files by historical timings; keep shards balanced).
SKILL.md
npx skills add https://github.com/bjornmelin/dev-skills --skill pytest-dev

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs10
repo stars5
Last updatedAugust 5, 2026
Repositorybjornmelin/dev-skills

What it does

Write low-flake, fast pytest suites and tune Python test CI with sharding, parallelism, and coverage.

Who is it for?

Writing low-flake pytest suites, designing fixtures and markers, fixing flakiness, and optimizing test runtime and CI.

Skip if: Non-Python test frameworks or general application code outside the test suite.

When should I use this skill?

Asked about pytest best practices, pytest 9.x features, pytest plugins, or test performance and CI tuning.

What you get

High-signal, low-flake, fast pytest suites and CI configs with measurable wins in runtime, flake rate, and coverage quality.

  • low-flake pytest test suites
  • fixture and marker design
  • CI configs with sharding and parallelism

By the numbers

  • 5-step default workflow
  • 5-step high-ROI optimization playbook
  • 3 bundled helper scripts

Files

SKILL.mdMarkdownGitHub ↗

pytest-dev

Produce high-signal, low-flake, fast pytest suites and CI configs, with an explicit focus on measurable wins (runtime, flake rate, coverage quality).

Default workflow

1. Classify the tests

  • Unit: pure functions, no I/O (preferred)
  • Integration: DB/filesystem/multiprocess, slower but valuable
  • System/E2E: external services or UI, keep minimal and well-gated

2. Identify boundaries

  • Time/clock, randomness, network, filesystem, DB, env vars, global state

3. Pick the lightest seam

  • Prefer fakes/stubs over deep mocks; prefer dependency injection over

patching internals 4. Make it deterministic

  • Control time, seeds, tmp dirs; avoid order dependencies

5. Measure before optimizing

  • Collection time vs runtime; quantify with --durations + a single baseline

6. Harden for CI

  • Enforce marker discipline, strict config, timeouts, isolation for parallel

Quick commands

Use python3 by default. If the project uses uv, prefer uv run python.

  • Smallest repro: python3 -m pytest path/to/test_file.py -q
  • First failure only: python3 -m pytest -x --maxfail=1
  • Find slow tests: python3 -m pytest --durations=20 --durations-min=0.5
  • Emit JUnit for CI: python3 -m pytest --junitxml=reports/junit.xml
  • Parallelize on one machine (xdist): python3 -m pytest -n auto --dist load

Optimization playbook (high ROI)

1. Reduce collection scope (testpaths, norecursedirs, avoid importing heavy modules at import time). 2. Fix fixture scoping (move expensive setup up-scope; ensure isolation). 3. Eliminate sleeps and retries (poll with timeouts; mock time). 4. Parallelize safely (xdist; isolate worker resources: tmp/db ports). 5. Shard in CI (split test files by historical timings; keep shards balanced).

Use the bundled references

Read these when needed (keep SKILL.md lean):

  • references/pytest_core.md: fixtures, markers, parametrization, strict mode,

TOML config, subtests (pytest 9.x).

  • references/plugins.md: plugin selection + usage patterns.
  • references/performance.md: collection/runtime profiling and speedups.
  • references/ci_github_actions.md: sharding, artifacts, caching, concurrency.

Use the bundled scripts

  • scripts/junit_slowest.py: report slowest tests/files from JUnit XML.
  • scripts/junit_split.py: split test files into N shards using JUnit timings.
  • scripts/run_pytest_filelist.py: run pytest for a list of test files.

Quality gates

  • Tests pass in a clean environment (no hidden dependency on local state).
  • No network/time dependency without explicit control.
  • Parallel-safe or explicitly marked/serialized.
  • CI emits machine-readable artifacts when relevant (JUnit, coverage).

Related skills

FAQ

How does pytest-dev speed up slow suites?

It reduces collection scope, fixes fixture scoping, eliminates sleeps, parallelizes with xdist, and shards CI by historical timings.

Does it cover pytest 9.x features?

Yes, including subtests, strict mode, and TOML config, documented in the bundled references.

Testing & QAtestingdevops

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.