Skip to content

Fix parametrization, pytester, and JUnit XML edge cases - #15470

Closed
wiski-i wants to merge 5 commits into
pytest-dev:mainfrom
wiski-i:fix/verified-regressions
Closed

wiski-i wants to merge 5 commits into
pytest-dev:mainfrom
wiski-i:fix/verified-regressions

Conversation

@wiski-i

@wiski-i wiski-i commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Keep byte-valued parametrization IDs usable when Unicode string escaping is disabled. Previously, a byte ID could raise TypeError during collection.
  • Forward an explicit env mapping from pytester.popen() to the child process. Calls without an environment override retain the existing PYTHONPATH setup.
  • Feed byte input to pytester.run() through a temporary file. A child that leaves stdin unread can now return its exit code or time out without blocking the input write.
  • Write one JUnit XML element per captured stream for skipped tests. The output includes teardown, including when a failed test is followed by a skip during teardown.

Testing

  • Added regression tests and verified they fail before the fixes.
  • Ran the relevant suites on Python 3.10 and 3.14. The full Python 3.14 Windows run passed with 4,669 passed and no failures.
  • Ruff and mypy passed on all changed Python files.

OpenAI Codex (GPT-6) helped investigate, implement, and test the changes and prepare this PR description. Each commit includes an Assisted-by trailer. The submitter reviewed the changes before opening the PR.

@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Nov 27, 2026

Copy link
Copy Markdown
Member

🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it.

Closing. This bundles four unrelated changes, none tied to a reported issue. The JUnit XML part overlaps with #15456, which reworks testcase construction per item and fixes the duplicated skip output there. The pytester.popen(env=...) fix is useful on its own: please resubmit it as a single PR with its test and changelog entry. The bytes-ID case sits behind an option that explicitly forfeits support, and the unread-stdin case is not something we want to carry without a real report.


Generated by Claude Code

@wiski-i

wiski-i commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for bundling unrelated fixes in one PR. I wanted to contribute to pytest, and I appreciate you taking the time to review it.

Drafted with help from OpenAI Codex (GPT-6).

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

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants