test: run pytest with bounded parallel workers - #14
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de18bd46f6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| import pytest | ||
|
|
||
|
|
||
| def pytest_xdist_auto_num_workers(config: pytest.Config) -> int: |
There was a problem hiding this comment.
Mark the xdist hook optional for serial runs
When pytest-xdist is not loaded—for example, a maintainer runs python -m pytest -o addopts='' to debug serially or has only pytest installed—pluggy treats this conftest function as an implementation of an unknown hook and aborts collection with PluginValidationError: unknown hook 'pytest_xdist_auto_num_workers'. Decorating it with @pytest.hookimpl(optionalhook=True) or registering it only when xdist is present preserves that serial fallback.
Useful? React with 👍 / 👎.
| [tool.pytest.ini_options] | ||
| testpaths = ["tests"] | ||
| addopts = "--tb=short -q" | ||
| addopts = "-n auto --dist worksteal --tb=short -q" |
There was a problem hiding this comment.
Document the parallel pytest default
Because this line changes the repo-wide default uv run pytest behavior from serial execution to xdist work-stealing, it is a maintenance workflow change, but the diff does not update the existing docs or root entry-point docs to explain the new default or how to force serial/debug runs. Add a short note to an existing testing or release-maintenance doc so contributors can reproduce and troubleshoot the new execution policy.
AGENTS.md reference: AGENTS.md:L74-L76
Useful? React with 👍 / 👎.
| [tool.pytest.ini_options] | ||
| testpaths = ["tests"] | ||
| addopts = "--tb=short -q" | ||
| addopts = "-n auto --dist worksteal --tb=short -q" |
There was a problem hiding this comment.
Document the parallel pytest default
Because this line changes the repo-wide default uv run pytest behavior from serial execution to xdist work-stealing, it is a maintenance workflow change, but the diff does not update the existing docs or root entry-point docs to explain the new default or how to force serial/debug runs. Add a short note to an existing testing or release-maintenance doc so contributors can reproduce and troubleshoot the new execution policy.
Useful? React with 👍 / 👎.
Summary
pytest-xdist>=3.8,<4to the dev dependency group.-n auto --dist worksteal.max(1, min(8, floor(os.cpu_count()/2))).This branch includes current
main(restic retention safety, cryptography 50.0.0, and health-floor checks) merged without rewriting the published branch.Verification