Skip to content

ref: remove private helper usage from pydantic_ai tests - #7708

Open
Morningstar202604 wants to merge 1 commit into
getsentry:masterfrom
Morningstar202604:ref/pydantic-ai-tests-public-api
Open

Morningstar202604 wants to merge 1 commit into
getsentry:masterfrom
Morningstar202604:ref/pydantic-ai-tests-public-api

Conversation

@Morningstar202604

Copy link
Copy Markdown

Description

Removed all direct calls to _set_input_messages from the pydantic_ai integration tests, following the review note on #5629. The tests now only exercise the public agent-run path.

Five standalone tests that called the helper in isolation (error handling, list content, system prompt part, instructions, prompts disabled) were removed because the agent-run tests in the same file already cover those scenarios. The two binary content tests were the only ones asserting the actual blob payload inside the span, so I rewrote them to run through a real Agent while keeping the same assertions.

Issues

Verification

  • pytest tests/integrations/pydantic_ai/ passes locally: 326 passed
  • ruff check and ruff format --check clean

Tests no longer call _set_input_messages directly. The standalone unit
tests for the helper (error handling, list content, system prompt part,
instructions, prompts disabled) were already covered by the agent-run
tests and were removed. The two binary content tests now run through a
real Agent while keeping the same span assertions.
@Morningstar202604
Morningstar202604 requested a review from a team as a code owner September 24, 2026 13:28

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor test_pydantic_ai to remove usage of internal functions within tests

1 participant