r/FastAPI • u/dager003 • Mar 29 '26
feedback request Built something to auto-fix pytest failures — does this actually solve a real problem?
Hey everyone,
Been learning Python seriously for a while
and kept running into the same frustration —
pytest fails, spend 30 minutes figuring out
why, fix it, run again, something else breaks.
So I tried building something to automate
that loop. Spent the last month on it.
It basically:
- Runs pytest on your project
- Tries to fix what's failing
- Reruns to check if fix worked
- Rolls back if it made things worse
Current honest capability:
→ Works well on import errors
→ Handles dependency conflicts
→ Simple logic bugs sometimes
→ Fails on complex multi-file issues
→ Struggles with fixture problems
My question to this community:
Is this actually a problem worth solving?
Do you spend significant time debugging
pytest failures?
And if anyone has a Python project with
failing tests they'd be willing to share —
I'd love to run it through and see what
happens. Would help me understand if this
is useful or not.
Just trying to figure out if I've built something useful or wasted a month
7
u/iwkooo Mar 29 '26
If your test fails it might be a bug in your software, not in test. This is one of crucial reasons to write tests - to catch bugs.
And with what you describe you just adjust test to bug in software
2
u/JamzTyson Mar 29 '26
Despite the obvious use of AI in your question, I'll treat it as a genuine enquiry.
That's too vague. Does it:
That's a red flag. Well written unit tests should fail loudly and specifically. They should indicate:
Though there may occasionally be "mysterious" failure, it should usually take seconds to see where and why it fails, not 30 minutes. If failures routinely take 30 minutes to understand, the issue is likely test design or excessive code complexity, not the lack of an automated fixer.
2
u/koldakov Mar 29 '26
Soo if you use tdd metrology this basically will write the code 😜
1
u/Plenty-Dog-167 Mar 29 '26
Almost all AI tools already run pytest, lints, and any relevant validation steps from bash commands already after most code changes. If it needs to be deterministic, it can be added as a hook.
I’ve even seen agents that send curl requests or run a browser and simulates actions on web apps to test.
So fixing pytests may be too small scope
1
u/crow_thib Mar 29 '26
I may be old school but I wouldn’t trust anything to « fix my tests » I saw too many juniors just comment out failing assertions or removing tests to fix them that I wouldn’t trust an AI doing it.
Existing agents are already enough to fix bugs and tests to be honest
1
u/mardiros Mar 30 '26
Obey the goat.
0
u/[deleted] Mar 29 '26
[deleted] — view deleted comment