Skip to content

tests: re-harden test_remote_usage_prog (replaces #507) - #1396

Open
RonnyPfannschmidt wants to merge 3 commits into
masterfrom
claude/project-thread-plqjgz
Open

RonnyPfannschmidt wants to merge 3 commits into
masterfrom
claude/project-thread-plqjgz

Conversation

@RonnyPfannschmidt

@RonnyPfannschmidt RonnyPfannschmidt commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Requested by Ronny · project thread

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

This replaces #507 by @blueyed. It keeps his original commit and adds a merge of current master on top of it. That PR's branch lives on a fork that we couldn't push the merge to.

Before: test_remote_usage_prog only checks for *usage: * and *error: my_usage_error. It would still pass if the worker's argparse prog were -c, which was the regression the test was meant to catch. The check was weakened in 93780dc.

After: the test matches the UsageError lines and requires prog to be pytest.py or __main__.py.

How: blueyed's re_match_lines assertion, merged into the current pytester-based version of the test (pytest 9 optparser split). The merge resolution only keeps the new assertion, alongside the test_remote_sys_path test that was added since. It passes locally on Python 3.13 with the pytest pinned by the repo.

  • Tests: test-only change
  • Changelog: changelog/1396.trivial.rst

🤖 Generated with Claude Code

https://claude.ai/code/session_012f14GcdYkiWd68e7zAvLhN

blueyed and others added 2 commits February 22, 2020 01:22
The meaning of the test is to check that "prog" is not "-c", which was
weakened in 93780dc.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012f14GcdYkiWd68e7zAvLhN
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012f14GcdYkiWd68e7zAvLhN

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused test-only change correctly enforces the intended worker program name.

0 open findings

What changed in this PR

Strengthens the remote usage test to prevent regression to a worker program name of -c.

Changes:

  • Validates UsageError output against pytest.py or __main__.py.
  • Adds a changelog entry crediting the original contribution.
File Description
testing/​test_remote.py Tightens worker usage-output assertions.
changelog/​1396.trivial.rst Documents the test hardening.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

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.

4 participants