Skip to content

test: add deferral negative cases and local ignores#5739

Open
ChunkyTortoise wants to merge 3 commits into
pydantic:mainfrom
ChunkyTortoise:test/deferral-negative-cases
Open

test: add deferral negative cases and local ignores#5739
ChunkyTortoise wants to merge 3 commits into
pydantic:mainfrom
ChunkyTortoise:test/deferral-negative-cases

Conversation

@ChunkyTortoise
Copy link
Copy Markdown

Summary

  • Adds negative-case coverage for deferral span handling.
  • Narrows broad exception assertions to the expected ValueError behavior.
  • Adds local agent artifact ignores from the portfolio audit branch.

Verification

  • git diff --check -> passed

Notes

  • No deploys performed.
  • No package installs performed.

ChunkyTortoise and others added 3 commits April 5, 2026 22:32
Verify that ModelRetry (ToolRetryError) and unexpected exceptions still
record spans as ERROR on v5 instrumentation -- only CallDeferred and
ApprovalRequired get UNSET status. Addresses the missing negative cases
called out in tests/AGENTS.md: 'Test both positive and negative cases
for optional capabilities.'

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The second test used the too-broad pytest.raises(Exception) which was
flagged by the B017 linter rule. Since the tool explicitly raises
ValueError, narrow to pytest.raises(ValueError, match=...) to
validate the specific exception type and message.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added size: S Small PR (≤100 weighted lines) chore labels May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore size: S Small PR (≤100 weighted lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant