Skip to content

chore(tests): consolidate duplicated mcp_tool_capture pattern across vertical test files #119

Description

@dougborg

Problem

frontapp_mcp_server/tests/conftest.py already defines a shared mcp_tool_capture fixture (a factory that registers a tools module against a fake FastMCP and returns the captured {name: callable} dict). However, five existing per-vertical test files still define their own copy of the same pattern locally:

  • tests/test_contacts_tools.py
  • tests/test_drafts_tools.py
  • tests/test_messages_tools.py
  • tests/test_tags_tools.py
  • tests/test_inboxes_tools.py

The conftest comment captures the intent:

Existing per-vertical test files (test_contacts_tools, test_drafts_tools, test_messages_tools, test_tags_tools, test_inboxes_tools) still define their own copy of the same pattern — migration is tracked as follow-up cleanup so this PR doesn't churn 5 working test files.

This issue is that follow-up cleanup.

Plan

  1. For each of the 5 files, replace the local FakeMCP/captured-dict scaffolding with the shared mcp_tool_capture fixture from conftest.py
  2. Remove the local class definitions
  3. Update fixture lists in the affected tests
  4. Keep the test bodies unchanged — only the setup-fixture wiring changes

Acceptance criteria

  • Five test files no longer define FakeMCP or local capture dicts
  • All tests pass (uv run poe test)
  • No regression in test count (currently 610 passing)
  • Conftest comment about "follow-up cleanup" can be removed

Note

This is a no-functional-change refactor; expected to be a small focused PR. Likely a half-hour of mechanical work but worth tracking so it doesn't bit-rot.

Reference

  • frontapp_mcp_server/tests/conftest.py:96-127 — the shared factory and the comment about pending migration

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions