Repository navigation
Move the tool-call resume test fixtures to tests/helpers - #717
Merged
neuromechanist merged 4 commits intoNov 11, 2026
Merged
Conversation
Pure move of the shared constants, tools, chunk builders, _assistant, resume_client and _parked_session; test_tool_call_streaming.py imports them. Tested: test_tool_call_streaming.py passes (18).
…er test modules (#710) Tested: ruff check and format clean; test_api suite run next.
…ures now live (#710) Comment-only change. Tested: ruff check and format clean.
… and formatting only; ruff and the three affected test files pass)
Member
Author
|
Review round 1 outcomes (fix in d6d317e; ruff check passes,
|
Member
Author
|
PM verdict: ready and merged. All acceptance criteria checked against the diff: helper module with docstring, all consumers import from it, no import from the old test module remains, resume_client imported with noqa, pure move (6242 tests collected on develop and on the branch, identical), stale comments updated, review round 1 findings all have outcomes, all checks green (Lint, Test 3.11/3.12, Frontend Tests), branch up to date. Closed #710. |
Merged
13 of 14 tasks
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.
Summary
The fixtures in
tests/test_api/test_tool_call_streaming.pywere imported by six other test modules, so refactoring that file broke them.They now live in
tests/helpers/tool_call_streaming.py(module docstring says what it holds and why), and every module, includingtest_tool_call_streaming.pyitself, imports them from there.Moved verbatim (same names, bodies and imports):
COMMUNITY,ALLOWED_ORIGIN,SEARCH_CALL_ID,DOCS_CALL_ID,CODE_CALL_ID,SECRET_QUERY,SEARCH_ARGS,ANSWER, the toolsnemar_search_datasetsandretrieve_toolcallstream_docs,_config,_pieces,_text,_anthropic_call,_bedrock_call,_openai_calls,_answer,_assistant, theresume_clientpytest fixture and_parked_session.Left in the test file because only its own classes use them:
_collect,_chat,_ask,_names,_tool_calls,_without_tool_calls,_resume(sounittest.mock.patchstays there too).Consumers switched:
test_client_tool_streaming.py,test_cut_off_replies.py,test_missing_usage.py,test_reply_usage.py,test_stream_failures.py,test_tool_call_anthropic_wire.py,test_usage_opt_out.py(theresume_fixturesalias now points at the helper module).git grep 'from tests.test_api.test_tool_call_streaming'returns nothing.Comments that pointed at the old module for the moved pieces were updated;
docs/community-widget.mdline 616 still names a file that exists and holds the streaming tests.Pure move: no test renamed, added or removed, no assertion or fixture body edited.
The only non-move edits are the two
# noqa: F811markers onresume_clientparameters intest_tool_call_streaming.py, which ruff needs now that the fixture is imported (same convention astest_reply_usage.py).Collected tests (
uv run pytest tests/ --collect-only -q, wholetests/, Python 3.12): 6242 before, 6242 after.Closes #710
Commands run
uv run pytest tests/ --collect-only -q | tail -3: 6242 collected before any edit and after (equal)git grep -nE 'test_tool_call_streaming|resume_fixtures' -- tests docs: only the intended references remainuv run pytest tests/test_api -q: 1868 passeduv run pytest tests/ -q --cov: 6149 passed, 92 skipped, 1 failed; the failure istests/test_tools/test_hed_suggest.py::test_real_program_suggests_a_schema_tag, which needs a local node and hed-lsp checkout (HED_LSP_PATH), does not touch these fixtures, and is not related to this changeuv run ruff check . && uv run ruff format --check .: cleanorigin/developimmediately before opening (already up to date)