Repository navigation
fix(pytest): handle --collect-only output correctly - #925
tangi-vass wants to merge 1 commit into
Conversation
pytest --collect-only produces a test tree with "N tests collected" summary, not "N passed/failed". The existing filter misclassified this as "No tests collected", causing agents to waste turns investigating phantom test discovery failures. - Detect --collect-only/--co and skip injecting -q/--tb=short - Route to dedicated filter that preserves the test tree - Fix misleading debug eprintln that hardcoded injected flags Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
dc9c20a to
1d2762b
Compare
Use rtk proxy when running pytest --collect-only while waiting for the fix. See rtk-ai/rtk#925
|
Confirming this is still live on
One thing worth folding in if this gets picked up: the real summary line carries a This is also the actual root cause behind #3565, which was filed against the The PR is |
|
Thanks for this. Closing it in favour of #4192, which fixes the same |
Summary
--collect-onlyoutput as "No tests collected" because the summary line says "N tests collected" not "N passed/failed"--collect-only/--coflag: skip injecting-q/--tb=short, route to dedicatedfilter_collect_only_output()that preserves the test treeeprintlnthat hardcoded injected flagsContext
Agents using RTK spent ~7 extra turns investigating phantom "test discovery is broken" before bypassing RTK with
rtk proxy.Test plan
test_filter_collect_only— verifies tree preserved and count correcttest_filter_collect_only_zero_items— edge case with 0 itemscargo fmt && cargo clippy --all-targetsclean🤖 Generated with Claude Code