Skip to content

Python(fix): pytest exit instead of raise on connection fail#606

Merged
alexluck-sift merged 1 commit into
al/python/feat/pytest-dev-branchfrom
al/python/feat/better-ping-msg
Jun 2, 2026
Merged

Python(fix): pytest exit instead of raise on connection fail#606
alexluck-sift merged 1 commit into
al/python/feat/pytest-dev-branchfrom
al/python/feat/better-ping-msg

Conversation

@alexluck-sift
Copy link
Copy Markdown
Collaborator

@alexluck-sift alexluck-sift commented Jun 2, 2026

Summary

On a failed connectivity ping in online mode, the pytest plugin now aborts the session with pytest.exit instead of raising pytest.UsageError.

Previously the ping ran during the first gated test's setup, so a session-scoped fixture failure was cached and re-raised once per test. A connection failure produced one error block per collected test, with the gRPC error truncated in the summary lines.

pytest.exit stops the session on the spot and prints the message once, before any test body runs, with the full error untruncated. The message text and exit code (4) are unchanged.

Notes

The check stays in the report_context fixture rather than moving to a collection hook, so the user-overridable sift_client and client_has_connection fixtures still resolve as documented.

@alexluck-sift alexluck-sift marked this pull request as ready for review June 2, 2026 03:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Python docs preview: https://sift-stack.github.io/sift/python/pr-606/

Deployed from 851fc5f. The link may take up to a minute to become live as GitHub Pages propagates.

@alexluck-sift alexluck-sift requested a review from ian-sift June 2, 2026 15:51
@alexluck-sift alexluck-sift merged commit e5f397c into al/python/feat/pytest-dev-branch Jun 2, 2026
19 checks passed
@alexluck-sift alexluck-sift deleted the al/python/feat/better-ping-msg branch June 2, 2026 19:04
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.

2 participants