# Find the Test That's Leaking Before the One That Fails

Original title: A tool for finding the causes of unstable Python tests

> Hacker News story 49113005 · language: en · submitted 2026-07-30
> Web version: https://zeli.app/story/49113005
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 19 · by [pomponchik](<https://news.ycombinator.com/user?id=pomponchik>) · 💬 1
[original](<https://github.com/mgaitan/pytest-leak-finder>) · [HN discussion](<https://news.ycombinator.com/item?id=49113005>)

## Summary

pytest-leak-finder is a plugin that helps you pinpoint which test is causing another test to fail when run together. It uses a binary search approach, similar to git bisect, to narrow down the culprit. After you run your test suite with the plugin, it identifies the failing test as the target and then systematically tests subsets of the preceding tests to isolate the one that leaves behind state causing the failure. This tool is especially useful for debugging flaky tests that pass in isolation but fail in a suite.

## Key quote

> You have a test that passes when executed alone but fails when running its suite. What's happening? My two cents that some previous test keeps the things dirty. But wich one/s, maybe the previous are a lot, right?

---

## Cite

- Page: https://zeli.app/story/49113005
- Date: 2026-07-30
- Source: github.com (https://github.com/mgaitan/pytest-leak-finder)
- Hacker News: https://news.ycombinator.com/item?id=49113005

## Other languages

- zh: https://zeli.app/zh/story/49113005 · markdown: https://zeli.app/zh/story/49113005.md
