test(langchain): activate test_responses_spec tests (#34564)

description by @mdrxy

- Enable `test_responses_spec.py` integration tests that were previously
skipped at module level
- Widen `ToolStrategy.schema` type annotation from `type[SchemaT]` to
`type[SchemaT] | dict[str, Any]` to match actual supported usage (JSON
schema dicts were already handled at runtime)
- Fix type annotations and linting issues in test file (modernize to
`dict`/`list`, add return types, prefix unused `_request` param)
- Improve generic typing in `load_spec` utility with bounded `TypeVar`

Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
Christophe Bornet
2026-01-09 23:44:33 +01:00
committed by GitHub
parent b4cd67ac15
commit 9ce73a73f8
4 changed files with 35 additions and 14 deletions

View File

@@ -139,7 +139,6 @@ ignore-var-parameters = true # ignore missing documentation for *args and **kwa
"ARG", # Arguments, needs to fix
]
"tests/unit_tests/agents/test_return_direct_spec.py" = ["F821"]
"tests/unit_tests/agents/test_responses_spec.py" = ["F821"]
"tests/unit_tests/agents/test_responses.py" = ["F821"]
"tests/unit_tests/agents/test_react_agent.py" = ["ALL"]