Skip to content

test(pydantic_ai): Fix instructions test for pydantic-ai >=2.36.0 - #7321

Merged
ericapisani merged 3 commits into
masterfrom
py-2755-pydantic-issues
Sep 1, 2026
Merged

test(pydantic_ai): Fix instructions test for pydantic-ai >=2.36.0#7321
ericapisani merged 3 commits into
masterfrom
py-2755-pydantic-issues

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Build the agent with public instructions/system_prompt kwargs instead of poking internal _instructions/_system_prompts attributes, and account for the joiner between multiple instructions changing from a single newline to a blank line in pydantic-ai 2.36.0.

There's normalization of instructions occurring under the hood as of 2.36.0 that we don't have a reason to interfere with within the tests, so moving the configuration of instructions and the system prompt to using the public Agent API.

Fixes PY-2755
Fixes #7306

Build the agent with public `instructions`/`system_prompt` kwargs instead
of poking internal `_instructions`/`_system_prompts` attributes, and
account for the joiner between multiple instructions changing from a
single newline to a blank line in pydantic-ai 2.36.0.

Fixes PY-2755
Fixes #7306
@ericapisani
ericapisani requested a review from a team as a code owner August 31, 2026 19:14
@linear-code

linear-code Bot commented Aug 31, 2026

Copy link
Copy Markdown

PY-2755

@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

121930 passed | ⏭️ 6762 skipped | Total: 128692 | Pass Rate: 94.75% | Execution Time: 437m 25s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2482 uncovered lines.
✅ Project coverage is 90.31%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.28%    90.31%    +0.03%
==========================================
  Files          193       193         —
  Lines        25621     25621         —
  Branches      9438      9438         —
==========================================
+ Hits         23132     23139        +7
- Misses        2489      2482        -7
- Partials      1436      1436         —

Generated by Codecov Action

@ericapisani
ericapisani merged commit 0d2dcf0 into master Sep 1, 2026
144 checks passed
@ericapisani
ericapisani deleted the py-2755-pydantic-issues branch September 1, 2026 13:54
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.

Address Pydantic AI tox failures

2 participants