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
testpathsconfig 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
Exit Codes and Signals in CI/CD: A Practical GuideA practical guide to process exit codes and signals in CI/CD - what 1, 2, 124, 126, 127, 130, 137, and 143 me…
Exit Codes and Signals in CI/CD: A Practical GuideA practical guide to process exit codes and signals in CI/CD - what 1, 2, 124, 126, 127, 130, 137, and 143 me…
CI Exit Code Lookup: What Does This Exit Code Mean?Instant lookup for CI/CD process exit codes - enter a code (137, 127, 143…) to see what it means, whether it…