You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor test_pydantic_ai to remove usage of internal functions within tests #5637
Hi! I’d like to work on this. I checked the latest master and found that the PydanticAI integration tests still import _set_input_messages directly and call it in 11 places.
My plan is to replace those direct internal calls with public PydanticAI/Sentry integration paths, using real message types and agent execution where appropriate. I’ll preserve coverage for error handling, disabled prompt capture, system instructions, and binary content, and run the dedicated PydanticAI tox environment plus Ruff.
I’ll implement this against the current master rather than reuse the previous closed PR. I’m using AI assistance while preparing the patch, but I’ll personally review and test every change before submission. Does this approach sound good?
I'd like to take this. I verified the previous attempt (PR #5713) was closed without merging, so no open PR exists. I'll refactor tests/integrations/pydantic_ai/ to use only public APIs and keep the existing coverage green.
Hi, I went through the pydantic_ai tests and dropped all the direct _set_input_messages calls.
The five unit tests that called the helper directly (error handling, list content, system prompt part, instructions, prompts disabled) turned out to be already covered by the agent-run tests in the same file, so I deleted them rather than porting the same assertions. The two binary content tests were the only ones that asserted the actual blob payload in the span, so I kept those but rewrote them to go through a real Agent run.
The pydantic_ai suite passes locally (326 tests), ruff is clean. Happy to adjust if the removal feels too aggressive for any of those cases.
Thanks for the context on the earlier attempts. Reading the contribution guidelines properly now — PRs need to wait for a maintainer response on the issue first, which my #7708 didn't do. My mistake.
The working diff is preserved on that closed PR (drops the direct _set_input_messages calls; the five helper-only unit tests are already covered by the agent-run tests). Happy to hold off on a new PR until someone from the team confirms the approach here — just let me know.
Activity
linear-code commentedon Mar 11, 2026
PY-2132
Bboyjie commentedon Sep 5, 2026
Hi! I’d like to work on this. I checked the latest master and found that the PydanticAI integration tests still import
_set_input_messagesdirectly and call it in 11 places.My plan is to replace those direct internal calls with public PydanticAI/Sentry integration paths, using real message types and agent execution where appropriate. I’ll preserve coverage for error handling, disabled prompt capture, system instructions, and binary content, and run the dedicated PydanticAI tox environment plus Ruff.
I’ll implement this against the current master rather than reuse the previous closed PR. I’m using AI assistance while preparing the patch, but I’ll personally review and test every change before submission. Does this approach sound good?
DawnofGenX commentedon Sep 22, 2026
I'd like to take this. I verified the previous attempt (PR #5713) was closed without merging, so no open PR exists. I'll refactor tests/integrations/pydantic_ai/ to use only public APIs and keep the existing coverage green.
Morningstar202604 commentedon Sep 24, 2026
Hi, I went through the pydantic_ai tests and dropped all the direct
_set_input_messagescalls.The five unit tests that called the helper directly (error handling, list content, system prompt part, instructions, prompts disabled) turned out to be already covered by the agent-run tests in the same file, so I deleted them rather than porting the same assertions. The two binary content tests were the only ones that asserted the actual blob payload in the span, so I kept those but rewrote them to go through a real Agent run.
The pydantic_ai suite passes locally (326 tests), ruff is clean. Happy to adjust if the removal feels too aggressive for any of those cases.
Morningstar202604 commentedon Sep 29, 2026
Thanks for the context on the earlier attempts. Reading the contribution guidelines properly now — PRs need to wait for a maintainer response on the issue first, which my #7708 didn't do. My mistake.
The working diff is preserved on that closed PR (drops the direct
_set_input_messagescalls; the five helper-only unit tests are already covered by the agent-run tests). Happy to hold off on a new PR until someone from the team confirms the approach here — just let me know.