Skip to content

Python: added test to validate status set#2265

Merged
eavanvalkenburg merged 1 commit intomicrosoft:mainfrom
eavanvalkenburg:otel_test
Nov 19, 2025
Merged

Python: added test to validate status set#2265
eavanvalkenburg merged 1 commit intomicrosoft:mainfrom
eavanvalkenburg:otel_test

Conversation

@eavanvalkenburg
Copy link
Member

Motivation and Context

Adds a test to validate that status is set to error for a execute_tool span.
Closes: #2217

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings November 17, 2025 09:16
@markwallace-microsoft
Copy link
Member

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL14965222785% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
2039 129 💤 0 ❌ 0 🔥 38.166s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces a complex mock-based test for exception handling with a simpler, more focused test that validates error status setting for function execution telemetry. The new test directly tests the ai_function decorator's error handling capabilities rather than mocking internal observability components.

Key Changes

  • Removed unused imports (MagicMock, patch) that were only used in the old test
  • Added ai_function import to support the new test
  • Replaced test_agent_run_with_exception_handling with test_function_call_with_error_handling that tests actual function execution errors

@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Nov 19, 2025
Merged via the queue into microsoft:main with commit 4e339f8 Nov 19, 2025
30 checks passed
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Python: No failure message shown in tracing when function calling fails

5 participants