Skip to content

Collect the tests from where they are - #139

Merged
martin-s-a merged 1 commit into
mainfrom
collect-the-tests-from-where-they-are
Sep 7, 2026
Merged

martin-s-a merged 1 commit into
mainfrom
collect-the-tests-from-where-they-are

Conversation

@martin-s-a

Copy link
Copy Markdown
Contributor

pytest is given no path, so it walks everything under the root looking
for tests. That is how it found pybind11's own suite when the fetched
sources briefly landed inside the checkout, and failed two jobs
collecting a conftest.py that imports a module nobody had built.

Naming the directory ends the class of failure rather than the instance,
and stops the walk descending into build/ and external/rexlib on
every run.

The check that matters

testpaths fails silently when it is wrong: tests outside the named
directory stop running and nothing says so. All twenty-two test files
this repository tracks are under tests/, and none matches pytest's
patterns anywhere else.

The run confirms it. The last build to reach collection reported
collected 296 items / 1 error — the 296 ours, the error pybind11's. If
this run reports 296 collected and no error, nothing was lost.

🤖 Generated with Claude Code

pytest is given no path, so it walks everything under the root looking
for tests. That is how it found pybind11's own suite when the fetched
sources briefly landed inside the checkout, and failed two jobs
collecting a conftest that imports a module nobody built.

Naming the directory ends the whole class of failure, and stops the walk
descending into build/ and external/rexlib on every run. All twenty-two
test files live there; nothing moves.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@martin-s-a martin-s-a self-assigned this Sep 7, 2026
@martin-s-a martin-s-a added the enhancement New feature or request label Sep 7, 2026
@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

@martin-s-a
martin-s-a merged commit 06c8ea9 into main Sep 7, 2026
45 checks passed
@martin-s-a
martin-s-a deleted the collect-the-tests-from-where-they-are branch September 7, 2026 08:35
@martin-s-a martin-s-a added the github_actions Pull requests that update GitHub Actions code label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant