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:
- Search for all functions that transitively call the modified functions (not just direct callers).
- 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."
Lesson learned from PR #903 (infer dependencies from setup.cfg)
When adding a new file manager (e.g.
SetupCFGManager) read to_deps.py'sget_project_deps()orget_dep_groups(), the agent correctly updatedtests/usethis/test_deps.pybut missedtests/usethis/test_init.py, which callswrite_simple_requirements_txt()— a function that transitively callsget_project_deps().This caused 5 CI test failures:
tests/usethis/test_init.py::TestWriteSimpleRequirementsTxt::*all raisedUnexpectedSetupCFGIOErrorbecauseSetupCFGManagerwas not opened in the test context.Root cause
The agent only searched for direct callers of
get_project_depsandget_dep_groupsin tests, not for transitive callers (functions that call those functions).write_simple_requirements_txt()in_init.pycallsget_project_deps()but is tested in a different test file.Recommendation
When modifying
_deps.pyto add new file manager reads, the agent should:tests/usethis/test_init.py,tests/usethis/test_deps.py, andtests/usethis/_core/test_core_tool.py— not justtest_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."