Your CI is green. Your tests might be lying.
Description and use
testguard detects patterns that hide real bugs in test suites and can be used as a CI gate to prevent merging PRs that weaken test coverage.
Problem
A test suite can appear green while actually not exercising production code, due to patterns that mask failures.
Outcome
testguard identifies 10 suspicious patterns in a faulty test file and none in a clean one, enabling teams to catch hidden bugs before they reach production.
Workflow
- Run testguard on the test directory (e.g.,
python -m testguard tests/). - Review the report for suspicious patterns and their severity.
- Configure CI to fail on high‑severity findings using
--fail-on highor report only with--fail-on none. - In PR review, use diff mode (
testguard --diff HEAD main) to detect added or removed test patterns before merge.
Evidence
I shipped a bug last week that my test suite had "covered." The suite was green. The test just wasn't testing anything anymore.
testguard scans for exactly those patterns: empty-test, fake-pass, retry-loop, swallowed-assert, deleted-test, removed-assert, focused-test, no-assert, hardcoded-sleep, mock-only, skipped-test, expected-fail.
testguard reports patterns, not guilt. Treat each finding as "look here and decide", not "this code is cheating".
- Record date: 2026-10-19T12:41:22.984Z