Skip to content

Added tests and test suite - about 60% coverage - #20

Closed
Max Caldwell (maxtheman) wants to merge 1 commit into
langchain-ai:masterfrom
maxtheman:test/add-happy-path-test
Closed

Added tests and test suite - about 60% coverage#20
Max Caldwell (maxtheman) wants to merge 1 commit into
langchain-ai:masterfrom
maxtheman:test/add-happy-path-test

Conversation

@maxtheman

@maxtheman Max Caldwell (maxtheman) commented Aug 3, 2025

Copy link
Copy Markdown

Description:

Adds comprehensive test suite for the create_deep_agent function in the deepagents library. The tests verify the core functionality of agent creation with various configurations

Changes:

  • Created tests/ directory with init.py for proper Python package structure

  • Added test_create_deep_agent.py with 7 test cases - 60% coverage

  • Added pytest configuration to pyproject.toml with test paths and discovery settings

  • Added dev dependencies (pytest>=8.0.0, pytest-cov>=6.0.0) as optional dependencies in pyproject.toml

  • Fixed license format in pyproject.toml from table to string to resolve setuptools deprecation warning

  • Added CLAUDE.md with test running instructions and current project status

  • Added Development section to README.md with testing and build instructions

    Dependencies:

    • pytest>=8.0.0 (dev dependency)
    • pytest-cov>=6.0.0 (dev dependency)

    Testing:

    • Verified all 7 tests pass successfully
    • Tested that package builds successfully without warnings
    • Verified built wheel can be installed and imported correctly
    • Confirmed test instructions in README work as documented
platform darwin -- Python 3.11.13, pytest-8.4.1, pluggy-1.6.0 -- /Users/max/Documents/deepagents/venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/max/Documents/deepagents
configfile: pyproject.toml
testpaths: tests
plugins: anyio-4.9.0, langsmith-0.4.10, cov-6.2.1
collected 7 items

tests/test_create_deep_agent.py::TestCreateDeepAgent::test_create_deep_agent_happy_path PASSED                                                                                       [ 14%]
tests/test_create_deep_agent.py::TestCreateDeepAgent::test_create_deep_agent_with_subagents PASSED                                                                                   [ 28%]
tests/test_create_deep_agent.py::TestCreateDeepAgent::test_create_deep_agent_with_custom_model PASSED                                                                                [ 42%]
tests/test_create_deep_agent.py::TestCreateDeepAgent::test_create_deep_agent_with_custom_state_schema PASSED                                                                         [ 57%]
tests/test_create_deep_agent.py::TestCreateDeepAgent::test_create_deep_agent_with_multiple_tools PASSED                                                                              [ 71%]
tests/test_create_deep_agent.py::TestCreateDeepAgent::test_create_deep_agent_empty_tools PASSED                                                                                      [ 85%]
tests/test_create_deep_agent.py::TestCreateDeepAgent::test_create_deep_agent_complex_scenario PASSED                                                                                 [100%]

====================================================================================== tests coverage ======================================================================================
____________________________________________________________________ coverage: platform darwin, python 3.11.13-final-0 _____________________________________________________________________

Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
venv/lib/python3.11/site-packages/deepagents/__init__.py        3      0   100%
venv/lib/python3.11/site-packages/deepagents/graph.py          20      0   100%
venv/lib/python3.11/site-packages/deepagents/model.py           3      1    67%
venv/lib/python3.11/site-packages/deepagents/prompts.py         5      0   100%
venv/lib/python3.11/site-packages/deepagents/state.py          16      5    69%
venv/lib/python3.11/site-packages/deepagents/sub_agent.py      37      7    81%
venv/lib/python3.11/site-packages/deepagents/tools.py          59     44    25%
-------------------------------------------------------------------------------
TOTAL                                                         143     57    60%

@ASTXRTYS

Copy link
Copy Markdown

✅ VERIFICATION COMPLETED - The /tokens command accurately emits actual token counts for the agent with 99.4% accuracy. Comprehensive testing confirms the token counting system correctly accounts for all middleware-injected content and uses the model's official tokenizer. No changes required.

@vtrivedy

Copy link
Copy Markdown
Collaborator

not needed, thanks for this. in general best to avoid committing and relying on claude.md directly for this repo

@maxtheman
Max Caldwell (maxtheman) deleted the test/add-happy-path-test branch December 29, 2025 20:33
james8814 pushed a commit to james8814/deepagents that referenced this pull request May 3, 2026
CTO 第 8 次失误修复 — 5 天 CTO 工作全部未 git commit,由 pmagent 团队应用 ADR v5 langchain-ai#22
audit CTO sync claim 时 catch("我昨天已 sync" vs git status untracked)。

核心架构决策档案
- decisions/0002-fork-customization-strategy.md (ADR-0002 v3) — Plan H+ 三方签字 ACCEPTED
  - 含 ADR 评审 checklist v1+v2+v3+v4+v5(langchain-ai#1-langchain-ai#22 完整体)
  - v5 langchain-ai#22 fact-check 必须含对照实验(CTO 第 6 次失误 + pmagent 5 次同型失误沉淀)
  - v5 langchain-ai#20 角色权限边界 + langchain-ai#21 governance 边界
  - 含 CTO 6 次失误谱系 + 元层观察(langchain-ai#22 不强制纳入)

主设计文档
- 2026-05-02-plan-h-plus-final.md — Plan H+ v3 完整设计(含 src/agent_assembly/ namespace v3 修订)

历史方案档案(HISTORICAL/SUPERSEDED)
- 2026-04-29 ~ 2026-05-02 v1 → v4 → Plan H+ 演进 8 次方向探索
- spike/ 步骤 1+2 reference template

应用 ADR v5 langchain-ai#16 fact-check + langchain-ai#22 实证:
- git status untracked 实证已确认(pmagent v1.6 audit catch)
- 此 commit 修复 5 天工作未 commit 严重失误

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants