Commit fc33fac
test(pydantic-ai): assert content-equality + real await in on_result tests
Strengthen backward-compat guarantees for the on_result callback:
- test_streaming_output_unchanged_with_callback now asserts model_dump()
equality per yielded pair, not just type, proving the callback does not
alter streamed message content.
- test_async_callback_is_awaited adds a real suspension point
(await asyncio.sleep(0)) before its side effect, so the assertion only
passes if the converter actually awaits the returned coroutine.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 7a30e6e commit fc33fac
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
524 | 525 | | |
525 | 526 | | |
526 | 527 | | |
| 528 | + | |
527 | 529 | | |
528 | 530 | | |
529 | 531 | | |
| |||
534 | 536 | | |
535 | 537 | | |
536 | 538 | | |
537 | | - | |
538 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
539 | 547 | | |
540 | 548 | | |
541 | | - | |
| 549 | + | |
| 550 | + | |
542 | 551 | | |
543 | 552 | | |
544 | 553 | | |
545 | 554 | | |
546 | 555 | | |
547 | | - | |
548 | | - | |
| 556 | + | |
| 557 | + | |
0 commit comments