Skip to content

chore(tests): hoist integration_components fixture to conftest #467

@memtomem

Description

@memtomem

Context

PR #465 introduced tests/test_batch_add_tag_isolation.py which redefines the _isolate_memtomem_env + _StubCtx + integration_components fixture trio that already exists almost verbatim in tests/test_multi_agent_integration.py:56–127.

Both fixtures share the same intent: real BM25-only component stack on a tmp DB, hermetic against ~/.memtomem/config.json and MEMTOMEM_* env vars. Two callers is tolerable; a third would push it over the threshold for extraction.

Scope

Move into tests/conftest.py:

  • _MEMTOMEM_ENV_VARS constant
  • _isolate_memtomem_env(monkeypatch) helper
  • _StubCtx class
  • integration_components fixture (rename to make its scope clear, e.g. bm25_only_components)

Then drop the local copies from both files. No behavior change.

Why not in #465

PR #465 was a focused 24-line removal + 170-line test addition for the broadcast-tag bug. Pulling fixture extraction into the same PR would have been scope creep (feedback_one_change_per_pr.md). Tracked here so the next caller doesn't grow a third copy.

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions