Repository navigation
test: enable mypy checks for test_agent.py - #12761
Merged
Merged
Conversation
Contributor
|
@yavuz-yilmaz is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
anakin87
enabled auto-merge (squash)
September 17, 2026 10:33
Contributor
7 tasks done
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
test_agent.pyincrement left out of test: enable mypy typing checks for the agents tool-calling tests #12755.Proposed Changes:
test/components/agents/test_agent.pyis not included in the default mypy target and currently reports 82 errors when checked directly. Add it to thetypestarget and resolve those errors:Tool/ComponentTooland check for the socket attributes added by@component.Tool/Toolsetsubclasses. Their overrides still callsuper().warm_up()before recording success.monkeypatch.setattrfor mock methods and retain references to the mocks for the existing call/await assertions.The only added suppression is a documented
# type: ignore[arg-type]where the negative test deliberately passes a bare string to_select_tools. Its expectedTypeErrorand message assertion are preserved. Mypy settings are unchanged.How did you test it?
Local environment: Windows, Python 3.13.12, Hatch 1.18.0; mypy targets Python 3.12 as configured by the project.
hatch run test:types: 542 source files clean.hatch run test:unit test/components/agents/ --no-cov: 345 passed, 6 deselected.hatch run test:integration test/components/agents/test_agent.py::TestAgentUserPromptInPipeline: 2 passed.hatch run fmt-check test/components/agents/test_agent.py pyproject.toml: passed.git diff --check: passed.A separate Codex review repeated these checks, reproduced the original 82 errors using mypy's
--shadow-file, and compared warm-up behavior before and after. Live API tests and the full repository unit suite were not run.Notes for the reviewer
Changes are limited to the test file and its mypy target entry. Existing test cases and assertions are retained; production code is unchanged.
No release note is included for this test-only change; the current release-note workflow exempts
test:commits.AI disclosure: This PR was generated with OpenAI Codex. The complete patch was reviewed and tested locally, including the separate Codex review described above.
Checklist
test:title.