pr-test-guard

PR Test Guard checks pull requests for missing tests, uncovered changes, weak assertions, test weakening, suspicious mocks, and changes that survive targeted probes.

It gives reviewers clear signals about where to look closer without pretending to decide whether the code is correct.

Tests passed. What did they prove?

A green test run tells you that the current tests passed. It does not tell you whether the changed behavior was tested well.

PR Test Guard starts with the pull request, connects the code change to its test evidence, and flags gaps that ordinary CI results can miss.

SystemWhat it answers
Test runnerDid the tests pass?
Coverage reportWhich lines were executed?
PR Test GuardDoes this PR show obvious test-quality risks?

How it works

It follows the PR change to its related tests, gathers runtime and static evidence, and turns that into test-quality signals — six PR-scoped rule families:

RuleSignal
PTG001Production Python changed but the PR contains no test-file change.
PTG002A changed Python line is uncovered in the supplied coverage XML.
PTG003A newly added assertion has an obviously weak existence/truthiness shape.
PTG004A test was deleted, skipped/xfail-marked, or lost assertions.
PTG005A mock directly replaces a changed Python symbol, or a changed test mocks an unconstrained internal dependency.
PTG006An opt-in bounded targeted probe survives the configured tests.

Findings are advisory by default: they highlight where a reviewer should look, and each repository decides which rules, if any, become merge-blocking policy. No API key or LLM is required on the default path.

Get started

Install from a source checkout, then run inside any Git repository that contains the PR branch you want to review:

python3 -m pip install -e .
pr-test-guard check --base origin/main

If the project already produces a coverage.py XML report, add it as another signal:

pr-test-guard check --base origin/main --coverage coverage.xml

To run the same analyzer automatically on pull requests:

- uses: tigerless-labs/pr-test-guard@v0.2.5
  with:
    base: origin/${{ github.base_ref }}
    config: .pr-test-guard.yml

Rule actions (off, warn, error) are tunable per repository in .pr-test-guard.yml.

More in the works — built in the open, shipped fast.

Explore Tigerless Labs