Skip to content
Latchkey

Exit Code 5 in CI: What It Means and How to Fix It

Exit code 5 is application-defined; notably, pytest returns 5 when no tests were collected.

Code 5 has no universal meaning, but is well-known from pytest, where it means "no tests ran".

What it means

Tool-specific. For pytest, 5 = no tests were collected (often a path/config problem).

Common causes

  • pytest collected zero tests.
  • A test path or testpaths config is wrong.
  • A custom exit 5.

How to fix it

For pytest, check testpaths, the rootdir, and file naming (test_*.py). Otherwise consult the tool docs.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →