pytest collects code under .claude/ (and any other dot directory)
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 91/100
Research direction
The issue identifies pytest.ini and the norecursedirs setting. Read pytest’s default exclusions and check the repository’s configuration; then run pytest and compare collected items with the reported behavior. Done when dot directories are excluded by the configuration and redundant exclusions are removed.
Written by the indexing model from the issue text.
Description
pytest.ini sets
norecursedirs=dist build .tox .eggs
which replaces pytest's default rather than extending it. The default is
["*.egg", ".*", "_darcs", "build", "CVS", "dist", "node_modules", "venv", "{arch}"]
so the override drops .*, and every dot directory in the project root becomes collectable. .tox and .eggs are only in the list because that default was lost; they are each matched by .*.
This has become visible now that the Claude Code desktop app keeps its worktrees in .claude/worktrees/<name>, each a full checkout of the project. Combined with --doctest-modules, pytest collects those checkouts' tests and their copies of the package. In importlib_metadata that turns a clean run into:
$ pytest -q
28 failed, 772 passed, 3 skipped, 129 subtests passed
$ pytest -q --ignore=.claude
262 passed, 1 skipped, 43 subtests passed
The 28 failures are rival copies of the package competing over sys.modules and sys.meta_path, so they are both alarming and entirely spurious. Worse, they appear identically with a clean working tree, so the natural reading is that your own change broke something.
Restoring .* fixes it and lets the redundant entries go:
norecursedirs=dist build .*
Measured in importlib_metadata:
norecursedirs |
items collected |
|---|---|
dist build .tox .eggs |
803 |
dist build .* |
263 |
Listing .claude explicitly would work too, but it treats one symptom. Any agent or tool that parks a checkout in a dot directory reintroduces the problem, and .* is what pytest intends by default.
One thing worth a look before changing it: .* was presumably not dropped on purpose, but if some downstream project keeps collectable test code under a dot directory, this would stop collecting it.
- Dominant language
- No language data
- Stars
- 152
- Forks
- 38
- Avg merge
- 6h 27m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jaraco/skeleton
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Avoid need for return type declarations in testsPossibly taken @jaraco claimed this 196 days ago. Open
jaraco/skeleton#200 · 2 comments · 1 reaction · 2 assignees ·
Similar issues
-
cognition facet:consolidation memory ready size:S
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug low-priority
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dividebysandwich/rust-dos#1170 ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 2/5 Half a day Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
area: runtime automation chore cloudflare-workers consistency developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene javascript priority: P3 quality robustness testing tests
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
enhancement priority/P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
beettlle/pi-smart-router#200 ·