Skip to content

fix: handle pytest.exit in remote worker to prevent internal error - #1342

Closed
decembercomposer697-hue wants to merge 1 commit into
pytest-dev:masterfrom
decembercomposer697-hue:fix/pytest-exit-handling
Closed

decembercomposer697-hue wants to merge 1 commit into
pytest-dev:masterfrom
decembercomposer697-hue:fix/pytest-exit-handling

Conversation

@decembercomposer697-hue

Copy link
Copy Markdown

Fixes #1239: pytest.exit() during remote execution was uncaught.

When pytest.exit() is called during remote execution, it was
uncaught and caused an internal error. Now catches pytest.exit.Exit
and forwards the return code.

Copy link
Copy Markdown
Member

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

Closing. pytest_cmdline_main never lets pytest.exit() escape: pytest's wrap_session catches Exit in every phase, so this except branch cannot run and does not change #1239. There is also no test. #1438 fixes it. Our AI policy: https://github.com/pytest-dev/pytest/blob/main/CONTRIBUTING.rst


Generated by Claude Code

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pytest.exit causes internal error

2 participants