Repository navigation
Conversation
Keep controller progress at the requested verbosity while retaining serial live logging. Refs pytest-dev/pytest-xdist#1249. Co-authored-by: OpenAI Codex <noreply@openai.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
log_cli=trueor--log-cli-levelenables live logging, a pytest-xdist controller raises the global verbosity to 1 even though it runs no tests locally. Default progress becomes per-test verbose output, and-q/-qqlose their intended behavior.Require local session items before promoting verbosity in the logging plugin's
pytest_runtestloopwrapper. The controller keeps the requested progress verbosity, while serial runs,-n0, and--dist=noretain their existing live-log presentation. Log handlers, controller hook logging, file logging, and workercaplogcapture remain active. This adds no dependency on xdist internals and does not implement forwarding worker live logs.Fixes pytest-dev/pytest-xdist#1249. Related: #14667 changes CLI-enabled serial live-log presentation; this change is limited to sessions without local items and preserves serial behavior for both configuration and CLI logging options.
Regression tests use real pytest sessions and worker subprocesses. They cover default/quiet/verbose output,
log_cliand--log-cli-level, one and two workers, explicit--tx, serial execution modes, and hook/file logging without local items.Validation on Windows / CPython 3.12.10, with pytest-xdist 3.8.0, execnet 2.1.2, and Pluggy 1.6.0:
testing/loggingdirectory: 115 passed.f81686c: 4631 passed, 142 skipped, 13 xfailed, 1 non-strict xpassed, 1 failed. The failure istesting/test_parseopt.py::test_argcomplete: the machine's Windows System32 Bash output raises a GBK decoding error. The unchanged upstream source fails at the same subprocess read; no tests were modified or deselected to avoid it.pre-commit run --all-files --show-diff-on-failurehooks passed, including Ruff, mypy, zizmor, and codespell. Hooks configured for manual invocation were not run.git diff --checkpassed.Source base:
c9c19f8. Local editable-build version metadata was set to9.2.0.dev0via setuptools-scm's standard override because the shallow clone lacks tag ancestry; source identity and before/after comparisons use commit SHAs. Other platforms and Python versions have not been tested locally.AI assistance: OpenAI Codex prepared the patch, tests, and local validation notes.