CoverageTestRunner is a Python module for running unit tests and failing them if the unit test module does not excercise all statements in the module it tests.

For example, unit tests in module are supposed to test everything in the module, and if they don’t, it’s a bug in the test coverage. It does not matter if other tests happen to test the missing parts. The unit tests for the module should test everything in that module.

CoverageTestRunner uses, by Ned Batchelder to measure statement coverage, and the unittest module in the Python standard library. It has no other external requirements.


Obviously, this is not suitable to all programs, since their unit tests have not been structured with for this requirement. Also, only measure coverage on the statement level, so more fine-grained coverage requirements are not possible with this.


CoverageTestRunner is licensed under the GNU General Public License, version 3, or (at your option) any later version.