Skip to content

pytest-xdist for the unit tests - #47

Merged
Paebbels merged 1 commit into
devfrom
claude/pytest-xdist
Oct 17, 2026
Merged

Paebbels merged 1 commit into
devfrom
claude/pytest-xdist

Conversation

@pytooling-claude

Copy link
Copy Markdown

Unit Tests

  • tests/unit/requirements.txt: pytest-xdist ~= 3.8. pyTooling/Actions@r9 runs the unit tests with pytest-xdist workers (unittest_parallel, default auto) when it is installed; without it, every unit test job warned pytest-xdist isn't installed: running the tests serially. Locally the unit tests take 8 s instead of 20 s with -n auto.
  • tests/unit/Extension.py: Project._build ignores Python's warning about fork() in a multi-threaded process. A pytest-xdist worker is multi-threaded; Sphinx forks its reading processes in a parallel build, Python 3.12+ warns with a DeprecationWarning, and pyproject.toml turns it into an error. Rendering.Parallel in Extension.py and Download.py failed under -n auto with AttributeError: 'NoneType' object has no attribute 'terminate' (multiprocessing's Process.start() raised before the process existed, then Sphinx' cleanup called terminate() on it). Serially and with -n auto, all tests pass.

Related Issues and Pull-Requests

…() warning.

pyTooling/Actions@r9 runs the unit tests with pytest-xdist workers when it is installed, else it warns and runs them serially. In a pytest-xdist worker, the process is multi-threaded, so Python warns with a DeprecationWarning when Sphinx forks its reading processes, which pytest turns into an error: the parallel builds failed with "'NoneType' object has no attribute 'terminate'". Project._build ignores that warning.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@pytooling-claude
pytooling-claude Bot requested a review from Paebbels as a code owner October 17, 2026 15:38
@pytooling-claude pytooling-claude Bot added the CI: GitHub Actions Continuous Integration issues related to GitHub Actions (Windows, Linux and MacOS) label Oct 17, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@Paebbels
Paebbels merged commit 94bf426 into dev Oct 17, 2026
14 of 41 checks passed
@Paebbels
Paebbels deleted the claude/pytest-xdist branch October 17, 2026 15:41
@pytooling-claude pytooling-claude Bot mentioned this pull request Oct 17, 2026
@pytooling-claude pytooling-claude Bot mentioned this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: GitHub Actions Continuous Integration issues related to GitHub Actions (Windows, Linux and MacOS)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants