agentsclimarketplace

Pytest dev

Skill BjornMelin/dev-skills/skills/pytest-dev

World-class pytest engineer for Python: write/refactor tests, fix flakiness, design fixtures/markers, add coverage, speed up suites (collection/runtime), and optimize CI (GitHub Actions sharding, xdist parallelism, caching). Use when asked about pytest best practices, pytest 9.x features (subtests, strict mode, TOML config), pytest plugins (xdist/cov/asyncio/mock/httpx), or test performance/CI tuning.From its SKILL.md

Install
npx -y skills add BjornMelin/dev-skills --skill pytest-dev

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

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 5 stars5 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.

SKILL.md

3.1 KB, 682 tokens by cl100k_base, as published. Nobody here has run it

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).

What ships with it: 8 files

23.9 KB alongside SKILL.md, 3 of them executable

agents/

scripts/

Gives 1 of the 12 instructions most performance cost skills give in 682 tokens

Counted across 797 of the 1,117 authors here whose files we hold, read 2026-09-06

  • Check for product marketing context firstin 46 of 797, across 20 files
  • Measure before optimizinghere, and in 31 of 797, across 25 files
  • Profile first to identify the actual bottleneckin 23 of 797, across 22 files
  • Verify your robots.txt allows AI crawlersin 21 of 797, across 12 files
  • Import directly and avoid barrel filesin 19 of 797, across 15 files
  • Spawn all runs in the same turnin 18 of 797, across 11 files
  • Write a draft of the skillin 17 of 797, across 10 files
  • Understand the user's intentin 17 of 797, across 10 files
  • Use React.cache for per-request deduplicationin 16 of 797, across 11 files
  • Profile before optimizingin 16 of 797, across 14 files
  • Include specific numbers with sourcesin 15 of 797, across 8 files
  • Add lazy loading to below-fold imagesin 15 of 797, across 10 files

Said here and by no other author read

  • Classify the tests
  • Identify boundaries
  • Pick the lightest seam
  • Make it deterministic
  • Harden for CI
  • Reduce collection scope

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. 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.