Skip to content

docs: import sys in the captured output example - #15008

Open
Hugohong258 wants to merge 3 commits into
pytest-dev:mainfrom
Hugohong258:work/round-five
Open

docs: import sys in the captured output example#15008
Hugohong258 wants to merge 3 commits into
pytest-dev:mainfrom
Hugohong258:work/round-five

Conversation

@Hugohong258

Copy link
Copy Markdown

Add the missing sys import to the capsys example, which writes to sys.stderr.

Validation: copied the original snippet into a standalone test module and confirmed it fails with NameError: name 'sys' is not defined; the updated snippet passes using this checkout. The Sphinx HTML build passes with warnings treated as errors.

Co-authored-by: OpenAI Codex <noreply@openai.com>

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we run this via regendoc

Co-authored-by: OpenAI Codex <codex@openai.com>
@Hugohong258

Copy link
Copy Markdown
Author

Yes, good point. I've made the example regendoc-managed by adding a # content of test_output.py marker and a pytest -q test_output.py output block. I verified that the new regendoc action reproduces the checked-in output, and the pre-commit hooks and Sphinx docs build pass.

@RonnyPfannschmidt RonnyPfannschmidt added the skip news used on prs to opt out of the changelog requirement label Sep 13, 2026

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, wanna add to authors as well? else we merge tomorrow

Co-authored-by: OpenAI Codex <codex@openai.com>
@Hugohong258

Copy link
Copy Markdown
Author

Thanks! I’ve added Hugohong258 to AUTHORS in alphabetical order.

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

Labels

skip news used on prs to opt out of the changelog requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants