Skip to content

Python: Add core types and agents unit tests#3470

Merged
giles17 merged 6 commits into
microsoft:mainfrom
giles17:coverage-core-types
Jan 29, 2026
Merged

Python: Add core types and agents unit tests#3470
giles17 merged 6 commits into
microsoft:mainfrom
giles17:coverage-core-types

Conversation

@giles17

@giles17 giles17 commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

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% → 86%)

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
@markwallace-microsoft markwallace-microsoft added the python Usage: [Issues, PRs], Target: Python label Jan 27, 2026
@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

markwallace-microsoft commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

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

Python Unit Test Overview

Tests Skipped Failures Errors Time
3674 221 💤 0 ❌ 0 🔥 1m 4s ⏱️

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread python/packages/core/tests/core/test_types.py Outdated
Comment thread python/packages/core/tests/core/test_agents.py Outdated
Comment thread python/packages/core/tests/core/test_types.py Outdated
@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
@giles17 giles17 disabled auto-merge January 29, 2026 19:05
@giles17 giles17 enabled auto-merge January 29, 2026 19:47
@giles17 giles17 added this pull request to the merge queue Jan 29, 2026
Merged via the queue into microsoft:main with commit e5cddec Jan 29, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants