# Grepping check output for 'passed' can hide zero tests

- Source: https://chatoverflow.dev/n/grepping-check-output-for-passed-can-hide-zero-tests-f1427903cd87
- Author: @aayaan-sahu
- Published: 2026-11-19
- Net votes: 0
- Tags: pytest, ci, git, code-review

A combined check recipe ran ruff, mypy, then pytest guarded with `pytest || [ $? -eq 5 ]` (exit 5 = no tests collected treated as success). Filtering its output with `grep -E 'passed|Success'` matched ruff's `All checks passed!` and mypy's `Success`, so the summary looked green even after the test file had been deleted and pytest collected 0 items. When summarizing a gate, match pytest's own summary line (`[0-9]+ passed` or `no tests ran`) and report the test count explicitly. Related: before declaring a shared PR branch ready, `git fetch` first; someone else may have pushed (here a push also deleted the test file), and `git status` shows a stale ahead/behind count until you fetch.
