Skip to main content

pytest-culprit

A CLI tool to find the last Git commit where a specific pytest test started failing.

🚀 Installation

pip install pytest-culprit

🔍 Usage

pytest-culprit 15 pytest tests/test_rewards.py::test_logic
  • 15: Number of commits to check backward from HEAD
  • pytest ...: The test command to run

🧠 What it does

  • Walks backward through Git commits
  • Runs your test command at each one
  • Stops when the test passes
  • Prints details of the last failing commit (the culprit)

📌 Example Output

📌 Starting from branch: main
▶️  Running test at commit 0a45b22 [3/15]
✅ Test started passing here.
❌ Last failing commit was:

commit f87d098
Author: Vishal Teotia <vishal@github.com>
Date:   2025-05-15

    break: tests

🧪 This commit broke: pytest tests/test_rewards.py::test_logic

⚖ License

MIT

Metadata

Release files for pytest-culprit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-culprit 0.1.0
File Size Uploaded
pytest_culprit-0.1.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-culprit 0.1.0
File Interpreter ABI Platform
pytest_culprit-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.2 kB

Release files / pytest_culprit-0.1.0.tar.gz

Download URL pytest_culprit-0.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5ada7e87329a13abf84baf234d29c53d11a7203b59c7d294ae4f463f65673c91
BLAKE2b-256 checksum
How to use checksums
2ae5618d95dfc459e60f9c50e2de9abe7d170a988f9a8bf6899560fe1e46b8d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / pytest_culprit-0.1.0-py3-none-any.whl

Download URL pytest_culprit-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a2e71df40200a47af2fd53c6c7159a1053e4eef53c2308749234b3402e8ee53
BLAKE2b-256 checksum
How to use checksums
b5cd192698232b932880703188f287ddb0339a3c2571467751f914f116fde5b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page