Skip to content

Conversation

@giles17
Copy link
Contributor

@giles17 giles17 commented Jan 28, 2026

Motivation and Context

This PR adds unit tests to improve coverage for the core utility modules (_memory.py, _serialization.py, _threads.py) as part of issue #3356 (achieving 85-90% unit test coverage for agent-framework-core).

Description

Added comprehensive unit tests for:

_memory.py (81% → 96%)

_serialization.py (81% → 94%)

_threads.py (85% → 98%)

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 28, 2026 17:06
@github-actions github-actions bot changed the title Add core utilities unit tests (#3356) Python: Add core utilities unit tests (#3356) Jan 28, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Jan 28, 2026

Python Test Coverage

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

Python Unit Test Overview

Tests Skipped Failures Errors Time
3508 221 💤 0 ❌ 0 🔥 1m 3s ⏱️

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 adds comprehensive unit tests to improve coverage for three core utility modules (_memory.py, _serialization.py, _threads.py) in the Python agent-framework-core package, contributing to the goal of achieving 85-90% unit test coverage for the core package (issue #3356).

Changes:

  • Added 4 new tests for ContextProvider base class default implementations in test_memory.py (coverage: 81% → 96%)
  • Added 15 new tests for SerializationMixin edge cases including nested serialization, datetime handling, and dependency injection in test_serializable_mixin.py (coverage: 81% → 94%)
  • Added 16 new tests for ChatMessageStore, AgentThread, and state classes edge cases in test_threads.py (coverage: 85% → 98%)

Reviewed changes

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

File Description
python/packages/core/tests/core/test_memory.py Added tests for ContextProvider base class default implementations (thread_created, invoked, async context manager behavior)
python/packages/core/tests/core/test_serializable_mixin.py Added tests for advanced serialization scenarios including nested objects, datetime conversion, non-serializable handling, JSON deserialization, type identifiers, and dependency injection patterns
python/packages/core/tests/core/test_threads.py Added tests for AgentThread initialization states, ChatMessageStore deserialization, state management edge cases, and exception handling

"""Test to_dict skips non-serializable top-level attributes."""
import logging

class NonSerializable:
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Variable NonSerializable is not used.

Copilot uses AI. Check for mistakes.
@giles17 giles17 changed the title Python: Add core utilities unit tests (#3356) Python: Add core utilities unit tests Jan 28, 2026
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.

2 participants