Skip to content

Make the per-worker logging example runnable - #1446

Open
mikeyerke wants to merge 2 commits into
pytest-dev:masterfrom
mikeyerke:docs-runnable-worker-logging
Open

mikeyerke wants to merge 2 commits into
pytest-dev:masterfrom
mikeyerke:docs-runnable-worker-logging

Conversation

@mikeyerke

Copy link
Copy Markdown

Add the missing logging and os imports to the per-worker logging example so it works when copied into conftest.py.

  • Tested the unchanged and revised examples with two xdist workers on pytest 9.2.0. Before the change, pytest aborted with NameError. After the change, both tests passed and each worker wrote its warning to a separate file.
  • Add the numbered news fragment once GitHub assigns this PR a number.

Prepared with AI assistance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant