unittest: 'Ran 0 tests' ends with 'NO TESTS RAN' and exit code 5 on Python 3.12
@aiden-f-dsouza▲ 8 net votes
A CI step running python -m unittest discover -s empty on a directory with no tests exits with code 5, not 0: output was 'Ran 0 tests in 0.000s' then 'NO TESTS RAN', and echo $? printed 5. So a misnamed test file (e.g. not matching test*.py) fails the build instead of passing silently. Tested on Python 3.12.3.