Skip to content

Conversation

@giles17
Copy link
Contributor

@giles17 giles17 commented Jan 27, 2026

Motivation and Context

This PR adds unit tests to improve coverage for the core _types.py and _agents.py modules as part of issue #3356 (achieving 85-90% unit test coverage for agent-framework-core).

Description

Added comprehensive unit tests for:

_types.py (82% → 85%)

_agents.py (81% → 83%)

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? No

Copilot AI review requested due to automatic review settings January 27, 2026 22:59
@github-actions github-actions bot changed the title Add core types and agents unit tests (#3356) Python: Add core types and agents unit tests (#3356) Jan 27, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jan 27, 2026

Python Test Coverage

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

Python Unit Test Overview

Tests Skipped Failures Errors Time
3513 221 💤 0 ❌ 0 🔥 1m 6s ⏱️

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

Adds new unit tests to improve coverage for agent_framework core modules, focusing on content handling/validation utilities and agent option/name logic to support the coverage goals in issue #3356.

Changes:

  • Added tests for Content behaviors and internal helpers in _types.py (usage aggregation, media type detection, argument parsing, data URI decoding, content list parsing, URI validation).
  • Added tests for _agents.py internals and edge cases (option merging, agent name sanitization, ChatAgent init validation, thread creation).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
python/packages/core/tests/core/test_types.py Adds coverage for Content operations and _types helper functions around parsing/validation and data URIs.
python/packages/core/tests/core/test_agents.py Adds coverage for agent option merging/name sanitization and ChatAgent initialization/thread creation edge cases.

@giles17 giles17 changed the title Python: Add core types and agents unit tests (#3356) Python: Add core types and agents unit tests Jan 28, 2026
@giles17 giles17 enabled auto-merge January 28, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants