Skip to content

Move the tool-call resume test fixtures to tests/helpers - #717

Merged
neuromechanist merged 4 commits into
developfrom
feature/issue-710-resume-fixtures-helpers
Nov 11, 2026
Merged

neuromechanist merged 4 commits into
developfrom
feature/issue-710-resume-fixtures-helpers

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

The fixtures in tests/test_api/test_tool_call_streaming.py were 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, including test_tool_call_streaming.py itself, 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 tools nemar_search_datasets and retrieve_toolcallstream_docs, _config, _pieces, _text, _anthropic_call, _bedrock_call, _openai_calls, _answer, _assistant, the resume_client pytest 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 (so unittest.mock.patch stays 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 (the resume_fixtures alias 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.md line 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: F811 markers on resume_client parameters in test_tool_call_streaming.py, which ruff needs now that the fixture is imported (same convention as test_reply_usage.py).

Collected tests (uv run pytest tests/ --collect-only -q, whole tests/, 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 remain
  • uv run pytest tests/test_api -q: 1868 passed
  • uv run pytest tests/ -q --cov: 6149 passed, 92 skipped, 1 failed; the failure is tests/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 change
  • uv run ruff check . && uv run ruff format --check .: clean
  • Rebased on origin/develop immediately before opening (already up to date)

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)
@neuromechanist

Copy link
Copy Markdown
Member Author

Review round 1 outcomes (fix in d6d317e; ruff check passes, ruff format --check tests src passes, tests/test_api 1868 passed):

  • tests/test_api/test_tool_call_anthropic_wire.py:4, 148-character line: fixed. The docstring paragraph is re-wrapped inside the 100-column limit with the helper pointer kept.
  • tests/test_api/test_cut_off_replies.py:18, docstring pointer: fixed. Added "(the shared pieces are in tests/helpers/tool_call_streaming.py)".
  • tests/test_api/test_tool_call_streaming.py:240, long noqa signature: fixed. The signature is wrapped like the sibling case so both # noqa: F811 markers read the same.

@neuromechanist
neuromechanist merged commit b8272c4 into develop Nov 11, 2026
7 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-710-resume-fixtures-helpers branch November 11, 2026 12:48
@neuromechanist

Copy link
Copy Markdown
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.

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.

1 participant