Picture this: It's a rainy Tuesday evening. You're sitting in a cozy, warm-lit home workspace, classical music playing in the background, a warm mug of coffee at your side. You just finished implementing a clean feature on your local machine. Your flow state is perfect.
You run a quick git commit and push to remote, eager to see your feature merge. You lean back, sip your coffee, and wait. And wait.
Forty-five minutes later, you get a Slack alert: CI Pipeline Failed. You context-switch out of your cozy evening to investigate, only to find a stupid import syntax error in a module you touched briefly. You fix the typo, push again, and wait another 45 minutes. Your evening flow is gone.
"Waiting for remote CI to tell you that local code is broken is the biggest tax on developer velocity."
In modern engineering, the "fail fast, raise fast" philosophy is widely praised but rarely practiced correctly. Over 60% of all remote CI failures are caused by errors that could have been caught locally. But when your local test suite contains 20,000+ tests and takes half an hour to run, no developer wants to run it locally before committing.
Enter DeltaTest on Pre-Commit
The solution is to test locally—not by running the entire suite, but by running only what is relevant. Because DeltaTest maps exact code-line coverage to individual tests, it can analyze your git diff and execute only the tests affected by your current work.
Instead of 20,000 tests taking 30 minutes, it runs 18 tests in 2.4 seconds. This makes it light enough to run instantly as a **git pre-commit hook**.
$ git commit -m "feat: implement user auth session timeout"
Running pre-commit hooks...
DeltaTest Selection -----------------------------------------------------------
Analyzing local diff against branch 'main'...
Found 3 modified files (12 lines modified).
Selecting affected tests...
Running 15 affected tests out of 22,444 total unit-tests...
tests/test_auth_session.py::test_session_timeout FAILED [100%]
========================= 1 failed, 22429 skipped in 2.2s ========================
Aborting commit. Fix test failures before committing.
How "Fail Fast" Shortens Time-to-Production
By shifting testing all the way to the left (your local pre-commit stage), the impact on time-to-production is massive and compounding:
- No Broken Builds in CI: Developers catch typos, syntax bugs, and broken tests before they ever make it to remote. The CI master branch stays green.
- Zero Context Switching: When a test fails on pre-commit, the feedback is instant. You are still looking at the exact file and lines of code in your editor. You fix it in 5 seconds while remaining in the zone.
- Shorter PR Queues: Pull request reviews go faster because reviewers don't have to wade through red, failing builds. Green builds build confidence immediately.
Ready to bring the cozy back to coding? Integrate DeltaTest in 2 minutes.
Get Started for Free → Read the Pre-Commit Integration GuideSetting up the Hook
Integrating DeltaTest into your local pre-commit workflow is free to start (up to 500 tests) and then only $99/month for a pro developer. Setting it up is as easy as running two commands in your terminal:
$ pip install pytest-deltatest
$ delta install
Successfully installed pre-commit hook.
Now, whenever you run git commit, DeltaTest will intercept it, run the relevant tests in under 3 seconds, and block the commit if any test fails. Fail fast. Raise fast. Merge green.