Skip to content

agent: when adding file manager reads to _deps.py, agent must also update all transitive callers in tests #1808

@nathanjmcdougall

Description

@nathanjmcdougall

Lesson learned from PR #903 (infer dependencies from setup.cfg)

When adding a new file manager (e.g. SetupCFGManager) read to _deps.py's get_project_deps() or get_dep_groups(), the agent correctly updated tests/usethis/test_deps.py but missed tests/usethis/test_init.py, which calls write_simple_requirements_txt() — a function that transitively calls get_project_deps().

This caused 5 CI test failures:

  • tests/usethis/test_init.py::TestWriteSimpleRequirementsTxt::* all raised UnexpectedSetupCFGIOError because SetupCFGManager was not opened in the test context.

Root cause

The agent only searched for direct callers of get_project_deps and get_dep_groups in tests, not for transitive callers (functions that call those functions). write_simple_requirements_txt() in _init.py calls get_project_deps() but is tested in a different test file.

Recommendation

When modifying _deps.py to add new file manager reads, the agent should:

  1. Search for all functions that transitively call the modified functions (not just direct callers).
  2. Run a broader set of tests — at minimum tests/usethis/test_init.py, tests/usethis/test_deps.py, and tests/usethis/_core/test_core_tool.py — not just test_deps.py.

See also the stored memory: "When adding new file manager reads to _deps.py, ALL existing tests calling those functions must also open the corresponding file manager context."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions