agentsclimarketplace

Coverage data file under pytest cache

Skill kjuhwa/skills-hub/skills/build/coverage-data-file-under-pytest-cache

Self-correcting knowledge corpus for Claude Code — 9 stable shape clusters, bias-correction pipeline baked into contribution flow. 47 papers, 45 techniques, 1.1k skills.

Install
npx -y skills add kjuhwa/skills-hub --skill coverage-data-file-under-pytest-cache

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

  • 0 stars0 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

Move coverage data files into .pytest_cache/.coverage so pytest-xdist worker fragments (.coverage.<host>.<pid>.<random>) end up inside the already-gitignored cache dir instead of polluting the repo root.

SKILL.md

1.9 KB, as published. Nobody here has run it

Coverage Data File Under .pytest_cache

When to use

You run tests with pytest -n auto --cov and end up with dozens of .coverage.<hostname>.<pid>.<random> files at the repo root. They look like garbage, accidentally get committed, and clutter git status. There's a one-line fix.

How it works

Set tool.coverage.run.data_file to a path inside .pytest_cache/. pytest-xdist appends host/pid/random suffixes to whatever you set, so all the fragments land inside the already-gitignored cache directory.

Example

[tool.coverage.run]
# With pytest-xdist (-n auto), each worker writes a fragment; put them under
# .pytest_cache/ (already gitignored) instead of .coverage.<hostname>.* at repo root.
data_file = ".pytest_cache/.coverage"

Combine with a Makefile clean target that explicitly nukes leftovers from older runs:

clean:
    find . -maxdepth 1 \( -name '.coverage' -o -name '.coverage.*' \) -delete 2>/dev/null || true

Gotchas

  • .pytest_cache/ is gitignored by default in most Python templates; verify yours has it.
  • If you use coverage combine separately (e.g. in CI to merge fragments from parallel jobs), point its input/output paths at the same .pytest_cache/.coverage location.
  • Doesn't change behaviour for single-worker pytest --cov — it just keeps the folder tidy.

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.